when identity_insert is set to off. sql server code example
Example 1: identity insert on sql server
SET IDENTITY_INSERT sometableWithIdentity ON
INSERT sometableWithIdentity (IdentityColumn, col2, col3, ...)
VALUES (AnIdentityValue, col2value, col3value, ...)
SET IDENTITY_INSERT sometableWithIdentity OFF
Example 2: identity_insert is set to off
SET IDENTITY_INSERT tbl_content ON
Example 3: set identity_insert off
SET IDENTITY_INSERT [ [ database_name . ] schema_name . ] table_name { ON | OFF }