Step 1: Disable all the Constrains
Exec sp_msforeachtable “Alter Table ? NOCHECK Constraint all”
Step 2: Delete data from all the Tables
Exec sp_msforeachtable “Delete From ?”
Step 3: Re-enable all the constraints which we disabled in Step 1
Exec sp_msforeachtable “Alter Table ? With Check Check Constraint all”
No comments:
Post a Comment