Your technology certification is waiting. Enroll in Cloud Class ®
FROM sys.tables t
INNER JOIN sys.columns c ON t.object_id = c.object_id
INNER JOIN sys.default_constraints dc ON t.object_id = dc.parent_object_id
AND c.column_id = dc.parent_column_id
Open in new window
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
SELECT o.name, c.name, oc.name
FROM sysobjects o
INNER JOIN syscolumns c ON o.id = c.id
INNER JOIN sysconstraints ct ON o.id = ct.id AND c.colid = ct.colid
INNER JOIN sysobjects oc ON ct.constid = oc.id
WHERE o.xtype = 'U'
AND ct.status & 5 = 5
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.