Menu

#274 Cannot insert explicit value for identity column

closed-fixed
None
5
2013-02-05
2013-02-01
Andrew Ziem
No

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

1 Attachments

Discussion

  • Andrew Ziem

    Andrew Ziem - 2013-02-01

    here is the code

     
  • Oleg Broytman

    Oleg Broytman - 2013-02-01

    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.

     
  • Oleg Broytman

    Oleg Broytman - 2013-02-01
    • assigned_to: Oleg Broytman
     
  • Oleg Broytman

    Oleg Broytman - 2013-02-05
    • status: open --> closed-fixed
     
  • Oleg Broytman

    Oleg Broytman - 2013-02-05

    Fixed by [patches:#111].

     

    Related

    Patches: #111


Log in to post a comment.