SQL IDENTITY_INSERT is allow values to be inserted into the identity column of a table.
Identity column creates a numeric sequence value for you automatic.
It only allow one table in a session can have the IDENTITY_INSERT property set to ON.
If you need to change the table, you need to set the existing table IDENTITY_INSERT back to OFF.
SET IDENTITY_INSERT TableName OFF
If the value inserted is larger than the current identity value for the table, SQL Server automatically uses the new inserted value as the current identity value.
SET IDENTITY_INSERT TableName ON
http://sqltutorials.blogspot.co.nz/2008/04/sql-identityinsert.html
No comments:
Post a Comment