开发者

Re-insert records with IDENTITY Insert in SQL Server

Some records in a table (with no primary key) were deleted. I need to re-insert these records. One 开发者_如何学JAVAof my column is an IDENTITY column,

What should be my approach on a live database? Should I do IDENTITY_INSERT ON/OFF or is there a better way?


If you have to insert records whose identity column has to have a specific value (to restore eventual past references), then i would say yes, even if this is risky due to possible duplicates.

Otherwise you insert them again with the new IDENTITY values.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜