![]() |
Clean Records & reset Identity Columns |
Post Reply
|
| Author | |
Quote Reply
Topic: Clean Records & reset Identity ColumnsPosted: 02 Aug 2008 at 1:40am |
|
|
Well, I had a small issue regarding writing a script to clean a database we have and reset its identity columns in all tables. Although the database wasn't huge one (less than 100 tables) I had to trace relations to be able to delete child table's records before parent's ones because of the foreign key constraints. The solution is disable the foreign keys and delete records with no fear of any errors then enables the constraints again. /*Disable Constraints & Triggers*/ |
|
|
-Shawn.
|
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |