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
skrip untuk menghasilkan semua batasan
SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
dapatkan semua batasan di db lalu filter di meja Anda