Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Disable all the Constraint from the Database

Author  Topic 

sachin.hingole
Starting Member

15 Posts

Posted - 2009-03-14 : 08:01:22
Hi,

I want to disable all the constraing from the database
ex: If I have foregin key then want to keep the foregin key relation but want to delete the no check constraint on it

Right now I am using the below proc to alter constraint
exec sp_MSforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'

Thanks
Hingole Sachin

Sachin Hingole

edit: moved to correct forum
   

- Advertisement -