[freetds] MS SQL Server - connecting to named instancewithfreetds/DBD::Sybase?
Lowden, James K
LowdenJK at bernstein.com
Fri Jul 8 11:55:17 EDT 2005
> From: Curt Kiser
> Sent: Friday, July 08, 2005 7:53 AM
> If you are using a copy of SQL Server Personal Edition for your
> local copy the TDS protocol version for personal is different than
> Standard/Enterprise. You would need to compile FreeTDS using
> -with-tdsver=8.0. That should take care of your incorrect login
Or if not recompile, indicate the TDS protocol in freetds.conf or
> -----Original Message-----
> From: Knut Brobakken
> Sent: Friday, July 08, 2005 4:10 AM
> 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.
Your local SQL Server is by Microsoft and accepts TDS 5.0 connections?
> 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:
> use strict;
> use DBI;
> my $server = "184.108.40.206";
> my $port = "1433";
1433 is the default port. Your named instance may be on another port.
> I have also tried connecting using tsql from the command line with
> -H 220.127.116.11, -p 1433 and -U pubusr_102, and I get only "login
> failed for user pubusr_102".
That command bypasses freetds.conf, so your TDS protocol version (7.0 or
8.0) has to be either compiled in or set in TDSVER.
> What is the correct syntax for specifying the instance name and
> database in the connect string from DBD?
An instance name is just dataserver entry in freetds.conf: a tcp/ip
address (or DNS name), a port, and a protocol version.
In the next release (or the current snapshot), you'll be able to name
your instance in freetds.conf. The current UG describes how. But the
server doesn't use the instance name at connection time! What's really
happening is that the server runs a kind of mini-DNS: we issue a query
to iirc 1434 asking for the port assigned to a given name, then we
connect to the port. If we know the port in advance, we can skip the
> And is there a way to provide the instance name to tsql to test
> this from the command line?
No. If the instance is named in freetds.conf and you don't bypass it
with tsql, it will of course use the information. But there's no new
tsql parameter to override it; you just indicate the addrees & port
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s) named
above. If you are not the intended recipient, or an employee or agent responsible
for delivering this message to the intended recipient, any review, dissemination,
distribution or duplication of this communication is strictly prohibited. If you are
not the intended recipient, please contact the sender immediately by reply e-mail
and destroy all copies of the original message. Please note that we do not accept
account orders and/or instructions by e-mail, and therefore will not be responsible
for carrying out such orders and/or instructions. If you, as the intended recipient
of this message, the purpose of which is to inform and update our clients, prospects
and consultants of developments relating to our services and products, would not
like to receive further e-mail correspondence from the sender, please "reply" to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New York,
More information about the FreeTDS