Skip to content

odbc sqlserver notes

Ryan Culpepper edited this page Mar 24, 2018 · 12 revisions

ODBC SQL Server notes

Summary for users

Using #:strict-parameter-types? #t seems to work.

Notes to self

Fetching NUMERIC/DECIMAL fields works using SQL_ARD_TYPE

FIXME: add quirk to send times with fractional times with SQL_C_SS_TIME2?


Setting up a testing env

Setup

  • install SQL Server Express 2017
    • picked Basic, no customization
      • Server=localhost\SQLEXPRESS;Database=master;Trusted_Connection=True;
  • install SSMS 17.5
  • turn on protocols

ODBC configuration

  • Driver = ODBC Driver 13 for SQL Server or Driver = SQL Server Native Client 11.0
  • Server = localhost\SQLEXPRESS

Issue: Several concurrent tests fail with Connection is busy with results for another command (HY000)

Issues

Issue: time roundtrip causes error: "unsupported type (typeid: -154)"

Issue: Multi-statement string doesn't raise error.

  • workaround: skip test

Issue: tinyint roundtrip -1 causes overflow error (SQLSTATE 22003)

  • workaround: test as if smallint

Issue: timestamp test causes error: "Explicit conversion from data type datatime2 to timestamp is not allowed. (SQLSTATE: 22018)"

  • workaround: test as if datetime