Skip to Content.
Sympa Menu

freetds - Re: [freetds] Differentiate Sybase from SQL Server

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Differentiate Sybase from SQL Server
  • Date: Sun, 29 Jul 2018 07:53:39 +0100

2018-07-29 6:04 GMT+01:00 Igor Korot <ikorot01 AT gmail.com>:
> Hi,
> Is there a way to differentiate between Sybase and SQL Server
> other than by the TDS protocol version?
>
> I need an implementation of SQLDescribeCol(), but the information
> about column is located in a different table for those DBMSes.
> I can probably check what TDS version is used for a connection,
> but it is not very reliable way of doing things.
>
> Thank you.

@@version surely works, or you can use SQLGetInfo with SQL_DBMS_NAME
(see for instance
odbc_db_is_microsoft in src/odbc/unittests/common.c).

There's also an extension for SQLGetInfo to get the protocol version,
1300 will get
the version as 0xMM00mm (MM major mm minor), see odbc_tds_version in
src/odbc/unittests/common.c.

Frediano




Archive powered by MHonArc 2.6.24.

Top of Page