Click here to Skip to main content
15,897,519 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to disable a unique constraint
Posted

For disabling constraint this is the syntax

SQL
ALTER TABLE TableName NOCHECK CONSTRAINT ConstraintName


To remove Constraint this is the syntax

SQL
ALTER TABLE TableName DROP CONSTRAINT ConstraintName
 
Share this answer
 
try this:

SQL
ALTER TABLE [dbo.TableName] DROP CONSTRAINT [CONSTRAINTNAME]


hope it helps :)
 
Share this answer
 
Have a look at the "Disabling a constraint" section in this[^] msdn article.
 
Share this answer
 
hi they are not working for unique key constraint
 
Share this answer
 
Comments
André Kraak 5-Oct-11 3:10am    
If you have a question about or comment on the given solution use the "Have a Question or Comment?" option beneath the solution. When using this option the person who gave the solution gets an e-mail message and knows you placed a comment and can respond if he/she wants.

Please move the content of this solution to the solution you are commenting on and remove the solution. Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900