Over a million developers have joined DZone.

Listing Default Constraints

·
Sql Server 2005 - Retrieve Default Constraint Names


SELECT OBJECT_NAME(PARENT_OBJECT_ID) tableName, COL_NAME (PARENT_OBJECT_ID, PARENT_COLUMN_ID) columnName, NAME DEFAULT_CONSTRAINT_NAME
FROM SYS.DEFAULT_CONSTRAINTS
WHERE OBJECT_NAME(PARENT_OBJECT_ID) = '{table}'
and COL_NAME (PARENT_OBJECT_ID, PARENT_COLUMN_ID) = '{column}'
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}