By default, SQL Server automatically inserts an increment value for an IDENTITY column, when the IDENTITY_INSERT parameter is set to OFF. If you don't need an explicit value for the IDENTITY column, remove the IDENTITY column from the component schema.
How do you check Identity_insert is set to off?
How do you check if IDENTITY_INSERT is set to ON or OFF in SQL Server?
- Nathan's solution is the fastest: SELECT OBJECTPROPERTY(OBJECT_ID('MyTable'), 'TableHasIdentity'); ...
- Ricardo's solution allows more flexibility but requires the Column's identity name.
What does set Identity_insert do?
The set identity_insert command in SQL Server, as the name implies, allows the user to insert explicit values into the identity column of a table. ... Performing a “data-rescue” operation, that is you are trying to fix the data in a corrupted table.