#274 Cannot insert explicit value for identity column

Andrew Ziem

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

1 Attachments


  • 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

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks