Find all constraint information
SELECT OBJECT_NAME(OBJECT_ID) AS NameofConstraint,
SCHEMA_NAME(schema_id) AS SchemaName,
OBJECT_NAME(parent_object_id) AS TableName,
type_desc AS ConstraintType
FROM sys.objects
WHERE type_desc LIKE '%CONSTRAINT%'
--WHERE type_desc LIKE '%PRIMARY_KEY_CONSTRAINT%'
--WHERE type_desc LIKE '%FOREIGN_KEY_CONSTRAINT%'
--WHERE type_desc LIKE '%DEFAULT_CONSTRAINT%'
GO
SCHEMA_NAME(schema_id) AS SchemaName,
OBJECT_NAME(parent_object_id) AS TableName,
type_desc AS ConstraintType
FROM sys.objects
WHERE type_desc LIKE '%CONSTRAINT%'
--WHERE type_desc LIKE '%PRIMARY_KEY_CONSTRAINT%'
--WHERE type_desc LIKE '%FOREIGN_KEY_CONSTRAINT%'
--WHERE type_desc LIKE '%DEFAULT_CONSTRAINT%'
GO
Comments
Post a Comment
Hi User,
Thanks for visiting My Blog and please provide your valuable feedback and subscribe for more updates. Please don't post any spam content or comments.
Thank You