Tuesday, December 22, 2009

Turn off Identity Insert

To be able to insert a record into a table with a "hardcoded" ID you simply run:

SET IDENTITY_INSERT mytable ON

--run your insert code here

SET IDENTITY_INSERT mytable OFF

No comments: