For disabling all the constrains (foreign keys) of a Database



use this command to disable all the constraints:

EXEC sp_MSforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'


and after deletion or any operation on database set the constraints in by this command

EXEC sp_MSforeachtable 'ALTER TABLE ? CHECK CONSTRAINT ALL'

Comments

Popular posts from this blog

To Get All the Names of tables and Databases their data have changed in last 24 Hours And Backup those databases

Break comma separated into multiple rows in MYSQL

mysql global search procedure