develooper Front page | perl.dbi.users | Postings from February 2008

Connecting to different named instances on MS SQL 2005 from Linux

From:
Thomas Möller
Date:
February 27, 2008 08:01
Subject:
Connecting to different named instances on MS SQL 2005 from Linux
Hi all again!

As my work progress, I've encountered some more problems.
I'm connecting to many a few different MS SQL servers. However,
one is using named instances eg. 192.168.1.1/<instance-name>.
When connecting using the following syntax, it fails as suspected:

my $dbh = DBI->connect("DBI:Sybase:server=192.168.1.1/somedb", 'user',
'passwd', {PrintError => 1, AutoCommit => 1});

Are there any limitations in DBI/DBD::Sybase/FreeTDS that makes
this kind of connection impossible? If not, what would be the
correct syntax? Are there any other ways to get around this?

I've seen some mention methods like finding out on which particular
port each instance is working on, since the SQL server itself as
I understand it just "resolves" the instance name to the running
server and its assigned port. Then use this information in the
freetds.conf. However, this is not very smooth and I have trouble
gaining this inormation since I'm only given an IP address and an
instance name. The program I'm writing is supposed to be somewhat
scalable and dynamic as well. So, in short, I'd like to avoid this approach.

Any ideas?

Best regards
/Thomas M



Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About