查找表约束

–查找表约束
SELECT OBJECT_NAME(c.object_id),c.name,d.name
FROM sys.default_constraints d
JOIN sys.columns c ON d.parent_column_id = c.column_id AND d.parent_object_id = c.object_id
WHERE d.parent_object_id = OBJECT_ID(N’bdAllocateGroup’) –AND c.name = ‘msrepl_tran_version’;