views:

33

answers:

1

Why do i have to drop all constraints (keys in general) before i can drop a table in sql server. I dont understand why this would be necessary if I have permissions to drop the table and the know how to do it why not drop all constraints for me?

Is there some sort of technical or database design reason for this?

+2  A: 

Because of referential integrity, you (or someone else) might mistakenly attempt to delete a table that holds supporting information.

Just today, my office found an issue with records missing from a report due to account records being purged without checking for data integrity. Those records now have to be restored...

The idea is, as much as it's a pain to do, the process makes absolutely sure the operation is occurring as intended.

OMG Ponies