ctds doesn't properly convert Python types to aSQL type supported by the TDS version the client requested at connection time. See below for a simple example:
import datetime
import ctds
params = {
'server': 'localhost',
# ....
'tds_version': '7.2'
}
with ctds.connect(**params) as connection:
with connection.cursor() as cursor:
cursor.execute(
'''
SELECT :0
''',
(datetime.datetime.now(),)
)
This results in the following error:
_tds.ProgrammingError: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 3 (""): Data type 0x2A is unknown.
In this example, the client requested TDS 7.2, but ctds converted the datetime Python object to a DATETIME2 SQL type, which is not support until TDS 7.3.
ctds doesn't properly convert Python types to aSQL type supported by the TDS version the client requested at connection time. See below for a simple example:
This results in the following error:
_tds.ProgrammingError: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 3 (""): Data type 0x2A is unknown.
In this example, the client requested TDS
7.2
, but ctds converted thedatetime
Python object to aDATETIME2
SQL type, which is not support until TDS7.3
.