Skip to Content.
Sympa Menu

freetds - [freetds] MS SQL Server - connecting to named instance with freetds/DBD::Sybase?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Knut Brobakken" <piraya AT online.no>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] MS SQL Server - connecting to named instance with freetds/DBD::Sybase?
  • Date: Fri, 8 Jul 2005 11:10:00 +0200

I'm currently struggling to find the correct way of using freetds and
Perl/DBD::Sybase to connect to a named instance of an SQL Server from Linux.

I have built, installed and tested freetds (v 0.63, TDS version 5.0 with MS
db-lib compatibility), and have successfully connected to and queried my
local SQL Server, both
using tsql and using DBD::Sybase from perl.

But the problem arises when I'm trying to connect to an external server that
has multiple instances of SQL Server installed.

My user only has access to one particular instance and database, and I get
"incorrect login" when I try connecting to the server using the following
code:

#!/usr/bin/perl

use strict;

use DBI;
my $server = "101.64.2.5";
my $port = "1433";
my $db = "publish_prod";
my $username = "pubusr_102";
my $password = "VerySecret";

my $dbh = DBI->connect("dbi:Sybase:$server:$port", $username,$password);

$dbh->do("use $db");

I have also tried connecting using tsql from the command line with -H
101.64.2.5, -p 1433 and -U pubusr_102, and I get only "login failed for user
pubusr_102". I have connected to the server with Enterprise Manager on a
Windows box using these parameters, so I know that the username and password
are correct. I have also connected successfully to my local SQL Server using
the same syntax with tsql, so I know it is set up properly

It seems that I might need a way to provide the instance name of the SQL
Server and database when connecting.

What is the correct syntax for specifying the instance name and database in
the connect string from DBD?

And is there a way to provide the instance name to tsql to test this from
the command line?

Any help would be greatly appreciated.

Knut Brobakken
Chief Technical Officer

WebOn AS
___________________________________________


http://www.webon.net <http://www.webon.net/>

mobil: +47 982 06 053 | direkte: +47 33 35 33 08 | fax: +47 33 35 33 01
Brygge Vest, Jarlsø, P.O. Box 2198, N-3103 Tønsberg

WebOn - for din lønnsomhet





Archive powered by MHonArc 2.6.24.

Top of Page