pyodbc.IntegrityError: ('23000', "[23000] [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert duplicate key row in object 'dbo.test_pyodbc_table' with unique index 'test_pyodbc_table_SomeUniqueValue_u_nci'. (2601) (SQLExecDirectW); [01000] [Microsoft][SQL Server Native Client 10.0][SQL Server]The statement has been terminated. (3621)")
----
INFO:test_simple2_works:Inserting row 0 ...
INFO:test_simple2_works:Inserted row 0 ...
INFO:test_simple2_works:Inserting row 1 ...
Traceback (most recent call last):
File "C:\AltBeta\Dev\hg-ivanoe-pg\VariousTests\test_with_pyodbc.py", line 223, in <module>
print t.test_simple2_works() # this fails with exception
File "C:\AltBeta\Dev\hg-ivanoe-pg\VariousTests\test_with_pyodbc.py", line 191, in test_simple2_works
pyodbc.IntegrityError: ('23000', "[23000] [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert duplicate key row in object 'dbo.test_pyodbc_table' with unique index 'test_pyodbc_table_SomeUniqueValue_u_nci'. (2601) (SQLExecDirectW); [01000] [Microsoft][SQL Server Native Client 10.0][SQL Server]The statement has been terminated. (3621)")
----
DEBUG:SQL:Block started, connecting to "DRIVER={SQL Server Native Client 10.0};SERVER=test_srv;DATABASE=tempdb;Trusted_Connection=Yes"
DEBUG:SQL:Block started, connected to "DRIVER={SQL Server Native Client 10.0};SERVER=test_srv;DATABASE=tempdb;Trusted_Connection=Yes"
INFO:test_with_works:Inserting row 0 ...
INFO:test_with_works:Inserted row 0 ...
INFO:test_with_works:Inserting row 1 ...
ERROR:SQL:Error within block, rolling back and re-raising: <class 'pyodbc.IntegrityError'> (('23000', "[23000] [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert duplicate key row in object 'dbo.test_pyodbc_table' with unique index 'test_pyodbc_table_SomeUniqueValue_u_nci'. (2601) (SQLExecDirectW); [01000] [Microsoft][SQL Server Native Client 10.0][SQL Server]The statement has been terminated. (3621)"))
DEBUG:SQL:Block finished, closing...
DEBUG:SQL:Block finished, closed.
Traceback (most recent call last):
File "C:\AltBeta\Dev\hg-ivanoe-pg\VariousTests\test_with_pyodbc.py", line 226, in <module>
print t.test_with_works() # this fails with exception re-raised
File "C:\AltBeta\Dev\hg-ivanoe-pg\VariousTests\test_with_pyodbc.py", line 203, in test_with_works
pyodbc.IntegrityError: ('23000', "[23000] [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert duplicate key row in object 'dbo.test_pyodbc_table' with unique index 'test_pyodbc_table_SomeUniqueValue_u_nci'. (2601) (SQLExecDirectW); [01000] [Microsoft][SQL Server Native Client 10.0][SQL Server]The statement has been terminated. (3621)")
----
DEBUG:SQL:Block started, connecting to "DRIVER={SQL Server Native Client 10.0};SERVER=test_srv;DATABASE=tempdb;Trusted_Connection=Yes"
DEBUG:SQL:Block started, connected to "DRIVER={SQL Server Native Client 10.0};SERVER=test_srv;DATABASE=tempdb;Trusted_Connection=Yes"
INFO:test_with_fails:Inserting row 0 ...
INFO:test_with_fails:Inserted row 0 ...
INFO:test_with_fails:Inserting row 1 ...
ERROR:SQL:Error within block, rolling back and re-raising: <class 'pyodbc.IntegrityError'> (('23000', "[23000] [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert duplicate key row in object 'dbo.test_pyodbc_table' with unique index 'test_pyodbc_table_SomeUniqueValue_u_nci'. (2601) (SQLExecDirectW); [01000] [Microsoft][SQL Server Native Client 10.0][SQL Server]The statement has been terminated. (3621)"))
DEBUG:SQL:Block finished, closing...
DEBUG:SQL:Block finished, closed.
Traceback (most recent call last):
File "C:\AltBeta\Dev\hg-ivanoe-pg\VariousTests\test_with_pyodbc.py", line 221, in <module>
print t.test_with_fails() # this is the bad one: win32 error
File "C:\AltBeta\Dev\hg-ivanoe-pg\VariousTests\test_with_pyodbc.py", line 210, in test_with_fails
pyodbc.IntegrityError: ('23000', "[23000] [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert duplicate key row in object 'dbo.test_pyodbc_table' with unique index 'test_pyodbc_table_SomeUniqueValue_u_nci'. (2601) (SQLExecDirectW); [01000] [Microsoft][SQL Server Native Client 10.0][SQL Server]The statement has been terminated. (3621)")
... and the error:
---------------------------
Visual Studio Just-In-Time Debugger
---------------------------
An unhandled win32 exception occurred in python.exe [5080]. Just-In-Time debugging this exception failed with the following error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from Tools/Options/Debugging/Just-In-Time.
Check the documentation index for 'Just-in-time debugging, errors' for more information.