Re: Differentiate Sybase from SQL Server

Igor Korot <[email protected]> Sun, 29 Jul 2018 11:45:22 -0500
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CA+FnnTxrBc==VEweAvog8iCsT7uoTZ3fR5wSbx1o7nevfuREog@mail.gmail.com>
Hi, Frediano,

On Sun, Jul 29, 2018 at 1:53 AM, Frediano Ziglio <[email protected]> wrote:
> 2018-07-29 6:04 GMT+01:00 Igor Korot <[email protected]>:
>> 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
> [email protected]
> https://lists.ibiblio.org/mailman/listinfo/freetds