Article

SQL Server: How to retrieve the check constraints on columns in a specific table

sys.check_constraints contains a row for each CHECK constraint

1. parent_column_id – column id for which CHECK constraint is defined

2. parent_object_id – id of the object for whose column the constraint is defined.

3. create/modify_date – creation/modification date

4. definition – constraint’s criteria

Since the name of the column the constraint is built on is not present in sys.check_constraints, you need to join sys.check_constraints with sys.columns 

Comments Closed.