Re: Differentiate Sybase from SQL Server
Frediano Ziglio <[email protected]> Sun, 29 Jul 2018 07:53:39 +0100
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAHt6W4dApfEcD=+p-NwCgsVaMiqtq+XL3eqfEP0zNMjfb5F7Ww@mail.gmail.com> |
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. Frediano