SELECT df.name as DFconstraintName, a.name as ColumnName
FROM sys.all_columns a
JOIN sys.tables t ON a.object_id = t.object_id
JOIN sys.schemas s ON t.schema_id = s.schema_id
JOIN sys.default_constraints df ON a.default_object_id = df.object_id
WHERE s.name = 'SchemaName'
AND t.name = 'TableName'
AND a.name = 'ColumnName'
No comments:
Post a Comment