Get all Default Constraints for a table in SQL Server

31st Mar 2015

The below snippet will list all check constraints for a given table in SQL Server:

SELECT 
DC.Name
FROM
sys.schemas S
INNER JOIN Sys.objects O
on S.schema_id = O.schema_id
INNER JOIN Sys.default_constraints DC
ON O.object_id = dc.parent_object_id
WHERE S.name = 'SCHEMA_NAME'
AND O.name = 'TABLE_NAME'