We had a situation today where we need to take an unused column out of a table. The table had a foreign key that would not let us truncate. To get around the problem, our Lead Developer did this:
Did a CREATE TO script out for the foreign key
Dropped the foreign key from the table
Dropped the table from the data base.
Truncated the table
Reattached the table
Ran the CREATE script against the newly attached table to restore the foreign key.
It worked pretty easily. It seems to be a really quick way to do it without getting into more complicated methods.
No comments:
Post a Comment