Saturday, April 6, 2013

Enumerate All Default Constraints In A Database


The following script will enumerate all default constraints in the database the script is run against.


select c .name from
sys.all_columns a
inner join sys.tables b on a.object_id = b .object_id
inner join sys.default_constraints c on a. default_object_id = c .object_id


No comments:

Post a Comment