Ralpharama Archive. The archive is almost 20 years old, this website is no longer maintained.
Cannot insert explicit value error
Hits 11736 | Created 2007-06-15 | Modified 2007-06-15This error message had me scratching my head for a few minutes:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert
explicit value for identity column in table 'xxx'
when IDENTITY_INSERT is set to OFF.
The fault in the end was that I had added a primary key and set identity to YES in the database for this table, when in fact I was trying to insert the ID key field myself!
Examine your sql...
Removing both identity and primary key works if you are inserting the key yourself. If you want an auto-generated key, then ensure that identity is turned on and that you have a seed and are auto-incrementing. And also that you aren't adding the primary key yourself!
Comment Cannot insert explicit value error comment by John
Hits | Last Modified 2013-03-22
I found my answer here and it's simple:
This item has the following tags:
Useful? Donate for hosting costs
All content copyright (c) Ralpharama