Introduction
In a SQL server Table if you define a column as an identity column and if you try to insert value in this column then you will get an error message:
Below I have an Employee Table and ID column is identity here.

Now write an Insert query like below.

To insert Set IDENTITY_INSERT to ON
- SET IDENTITY_INSERT Employee ON

If you set IDENTITY_INSERT OFF then use below inserts statement to insert records.

You don’t need to write IDENTITY_INSERT OFF.



Gowtham RajamanickamTOP 100Posted Mar 12, 2015, 10:06 PM EDT
Good one...