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: Igor Korot <ikorot01 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 11:45:22 -0500

Hi, Frediano,

On Sun, Jul 29, 2018 at 1:53 AM, Frediano Ziglio <freddy77 AT gmail.com> wrote:
> 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.

I'm sure all of those will work, but I believe it will be an extra burden on
the
SQLDescribeParam implementation.
It just will be an extra database hit that is completely unnecessary.

I will see if John's solution will work.

Thank you.

>
> Frediano
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> https://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page