Some records in a table (with no primary key) were deleted. I need to re-insert these records. One of 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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.