Cannot insert explicit value for identity column
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
If I specify the identity with Microsoft SQL Server 9.0 SP4, I get this error
adodbapi.adodbapi.DatabaseError: (-2147352567, 'Exception occurred.', (0, u'Microsoft OLE DB Provider for SQL Server', u"Cannot insert explicit value for identity column in table 'tweet' when IDENTITY_INSERT is set to OFF.", None, 0, -2147217900), None)
Attached is the code and traceback
I am using Python 2.7.3 32-bit, Windows 7, sqlobject 1.3.2, adodbapi 2.4.2.2
here is the code
Please take a look at sqlobject/mssqlconnection.py, line 140 — SET IDENTITY_INSERT is set to ON for the table. Can you investigate what is going on? Add '&debug=1' to your DB URI and look through debugging output. If there is no SET IDENTITY_INSERT ON query — try to find out why has_identity is False at that point.
Fixed by [patches:#111].
Related
Patches:
#111