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