Friday, September 9, 2011

How to drop a check constraint


Syntax:
ALTER TABLE DROP CONSTRAINT ;
Example:
-- Drop a check constraint
IF EXISTS (SELECT 1 FROM sys.objects WHERE NAME = 'CK_ProductReview_Rating' AND type = 'C')
ALTER TABLE Production.ProductReview DROP CONSTRAINT CK_ProductReview_Rating;

No comments:

Post a Comment