SQL 找出 特定資料+特定欄位 之 條件約束
SELECT t.NAME AS [table],
c.NAME AS [column],
d.NAME AS [constraint]
FROM sys.default_constraints d
JOIN sys.tables t
ON t.object_id = d.parent_object_id
JOIN sys.columns c
ON c.object_id = t.object_id
AND c.column_id = d.parent_column_id
WHERE t.NAME = 'ApActive'
AND c.NAME = 'TransStamp'
沒有留言:
張貼留言