-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
triage neededFor new issues, not triaged yet.For new issues, not triaged yet.
Description
Describe the bug
When passing a NULL to a VARBINARY column for insert, an error occurs rather than the correct behavor.
To reproduce
import mssql_python
conn = mssql_python.connect([conn string], autocommit=True)
cur = conn.cursor()
cur.execute('create table bytestest (b varbinary(50));')
cur.execute('insert into bytestest values (?)', None)Exception message:
ProgrammingError: Driver Error: Syntax error or access violation; DDBC Error: [Microsoft][SQL Server]Implicit conversion from data type varchar to varbinary is not allowed. Use the CONVERT function to run this query.
Expected behavior
The None should be inserted as a NULL and I should see no error about VARCHAR.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
triage neededFor new issues, not triaged yet.For new issues, not triaged yet.