When the column has an identity field, and you want to restore the records with the same number as they had before deleted, you must turn on identity insert with this TSql command
SET IDENTITY_INSERT {YourTableName} ON
insert the deleted records
SET IDENTITY_INSERT {YourTableName} OFF
Thanks for sharing this. I need to do this on a live database. Can you tell me how this effects other operations like INSERT AND UPDATE in my table?
ReplyDelete