I have several tables setup with IDENTITY INSERT OFF and I need to change this to IDENTITY INSERT ON. A lot of these tables have 500,000+ records. These tables are basically mirrors of other tables and this is a live system. Can I change this without causing to much havoc?
Example: I have a StagingProducts table that users can change their product data in and then when they are done the push these changes over to the Products table which is basically my live table that end users query.
IDENTITY INSERT is OFF on this Products table so the ProductID which is the IDENTITY Column is getting huge and it differs from the StagingProducts tables. I can simplify some of my code greatly if this ProductID is the same across both tables and improve performance.
Is it safe to do this?
IDENTITY_INSERTis a session option that can be on for one table at a time and allows you to insert explicit values not a property of the tables themselves. – Martin Smith Mar 14 '12 at 18:56