SELECT top 1
'ALTER TABLE '+ SCHEMA_NAME(schema_id) + '.' + OBJECT_NAME(parent_object_id) +
' ADD CONSTRAINT ' + dc.name + ' DEFAULT(' + definition
+ ') FOR ' + c.name
FROM sys.default_constraints dc
INNER JOIN sys.columns c ON dc.parent_object_id = c.object_id AND dc.parent_column_id = c.column_id
skrypt do generowania wszystkich ograniczeń
SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
pobierz wszystkie ograniczenia na db, a następnie filtruj na swoim stole