Re: issue with connecting ms sql azure

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Mon, 3 Oct 2011 18:03:23 -0700
Andy Qian <[email protected]> wrote:

> I modified both sybase and freetds codes as you suggested, and tested 
> them. It worked. Now I can connect to azure server with modified
> sybase and freetds. I also tested with other versions of ms sql
> server. so far so good.

Excellent, Andy.  We look forward to you patch!  :-)

> for curiosity, is there any specific reason why the previous versions
> of sybase/freetds do not use the direct connection approach?  or is
> there any risk for using the direct-connection approach?

No risk, no.  

I can only tell you what I infer from the forensic evidence.  The
original login packet didn't have a database name field.  AFAIK, even
today there's no way to tell a Sybase server in the login packet what
database to use.  

The library reflects the protocol.  Sybase specified db-lib and ct-lib,
and neither one has a way to specify the database at connect time.
Sending "use dbname" isn't difficult, and does help distinguish between
"can't log in" and "can't use this database" errors.  

Microsoft included the dbname in the TDS 7.0 login packet.  If you ask
me, it was to support ODBC.  It does make SQL server look a bit more
like other RDBMSs that don't have a notion of "dbname".  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.