Tue, 11 Aug 2009 |
Filed in:
SQL
A very useful statement to check if a constraint exists before do something to it. Note, we can never edit a constraint before deleting it and re-create.
SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='dbo'
AND CONSTRAINT_NAME='FK_37_Page_FK' AND TABLE_NAME='PageContent'
If you think this post is useful, please recommend me at the bottom of the page. ;)