Total Pageviews

Existence of Constraint


With the help of below code, we can find out that particular constraint exist or not on a table. Its always good practice to check the existence of constraint in constraint creation script.

SELECT *
FROM sys.objects
WHERE parent_object_id = OBJECT_ID('<table name>')
AND name = '<constraint name>'