-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
bugSomething isn't workingSomething isn't workinginADOtriage doneIssues that are triaged by dev team and are in investigation.Issues that are triaged by dev team and are in investigation.
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
bugSomething isn't workingSomething isn't workinginADOtriage doneIssues that are triaged by dev team and are in investigation.Issues that are triaged by dev team and are in investigation.