Each DB instance is mapped to a specific port on the server. As long as the DBA does change the mapping, you can either ask the DBA what port the database is served on or you can use this routine to find out what instance is mapped to what port. Just call the program with the IP address of the server. Edit your freetds.conf file based on the output of this program.
#!/usr/bin/perl
$|++;
use strict;
use IO::Socket::INET;
my $message = new IO::Socket::INET(Proto => "udp", PeerPort => 1434, PeerAddr => "$ARGV[0]", LocalPort => 1434, Timeout => 10)
or die "Can't make UDP socket: $@";
$message->send("\x02");
print "Sent message, waiting on response\n";
my ($datagram,$flags);
$message->recv($datagram,1024,$flags);
#print "Got message from ", $message->peerhost,", flags ",$flags || "none",": $datagram\n";
my @PARAMS=split(';',substr($datagram,3));
print "------------------\n Server $ARGV[0] reports:\n\n";
for(my $i=0;$i<($#PARAMS)+1;$i+=2) {
if ($PARAMS[$i] eq "") {
print "---------\n";
$i--;
next;
};
print "$PARAMS[$i]=$PARAMS[$i+1]\n";
};
-Rusty