November 13, 2012 at 10:05 pm
HELP!! I have a deployment script that is building tables and setting default values to a column. I have built into it if exists, so that it can be rerunnable. The default constraints are system named when created I guess because they are funky names. So on the rerun, they are not being dropped due to the fact that I don't know those funky names. How do I drop the DFs when I don't know their names? Thank you in advance! :w00t:
November 13, 2012 at 10:16 pm
This should get you started. If you want to know the column to script it out you can use the parent_column_id and join to sys.columns.
SELECT OBJECT_NAME(parent_object_id) AS TableName, name AS DefaultName,*
FROM sys.default_constraints
November 13, 2012 at 10:41 pm
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy