Articles → SQL SERVER → Insert value in Identity column in SQL server

Insert value in Identity column in SQL server






Identity_insert statement





Syntax


Set Identity_insert table_name On/Off



Example





Click to Enlarge



Insert into TestTable values(1, 'Test1')








Set Identity_insert TestTable On
Insert into TestTable (id, Name) values(1, 'Test1')
Set Identity_insert TestTable Off





Click to Enlarge




Video





Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, November 08, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250