EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
--Drop all table in Database
EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"
--Enable all constrains in sql server
exec sp_msforeachtable @command1="print '?'", @command2="ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"
No comments:
Post a Comment
Comments Welcome