ViewState with example in asp.net C#

Friday, December 24, 2010

how to insert value in identity column in sqlserver

 Syntax:-


        Set identity_insert table_name on
           ----insert query----
         Set identity_insert table_name off


Example


SET IDENTITY_INSERT EMPLOYEE ON


     INSERT INTO EMPLOYEE(ID,NAME,ADD)
        VALUES(1988,'Shivam Gupta','New Delhi')


SET IDENTITY_INSERT EMPLOYEE OFF


Note:- here "Employee" is table name and "id" is identity column in employee table.

No comments:

Post a Comment