BUG: Incorrect SqlState on Constraint ViolationID: Q138540
|
If the Microsoft SQL Server ODBC Driver encounters a constraint violation it raises a SqlState of 37000 (Syntax error or access violation) instead of 23000 (Constraint violation).
Microsoft has confirmed this to be a problem in the Microsoft SQL Server
ODBC Driver version 2.50.0121. We are researching this problem and will
post new information here in the Microsoft Knowledge Base as it becomes
available.
This problem does not occur in version 2.65.0201.
If the driver encounters a SQL Server constraint violation, it correctly
passes the error message back to the client:
szSqlState = "37000"
*pfNativeError = 2627
szErrorMsg="[Microsoft][ODBC SQL Server Driver][SQL Server]
Violation of PRIMARY KEY constraint 'PK__testkey__cola__38CE74DF':
Attempt to insert duplicate key in object 'testkey'."
Additional query words: sql6 odbc SQLExecDirect SQLExecute
Keywords : kbinterop SSrvProg kbbug6.00
Version : 6.0 6.5
Platform : WINDOWS
Issue type :
Last Reviewed: April 16, 1999