Turning Off and On Identity Column in SQL Server
I have been moving over the data from one database to another. Issue came when data was entering in a table where idetity of a column was enable and I needed to enter the data as it is in identity column. I found solution.
SET IDENTITY_INSERT tablename ON
insert statement comes here
SET IDENTITY_INSERT tablename OFF
http://
http://
Contributed by:
Rohit kakria
I am software developer, moderator of xpode.com
Resourse address on xpode.com
http://www.xpode.com/Print.aspx?Articleid=496
Click here to go on website
|