Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Issue after copying data
Message
From
30/11/2010 16:16:03
 
 
To
30/11/2010 13:54:30
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Microsoft SQL Server
Category:
Scripting
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01491153
Message ID:
01491195
Views:
38
Why not back up and restore?

>>I use Red Gate SQL Data Compare to duplicate my production data to a testing database. Basically it's a DELETE followed by a bunch of INSERTs. However, it seems to not reset the identity Primary key. I keep getting this error:

{"Violation of PRIMARY KEY constraint 'Primary key_ApplicationNote'. Cannot insert duplicate key in object 'PreApplication.ApplicationNote'.\r\nThe statement has been terminated."}

I know I can go in and run a script to reset the identity, but I have to do that on every table every time I do this. Does anybody know of a way to avoid this? Or a global way to reset all identity columns?
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform