If you drop a table in SQL Server that has Keys, Indexes, Contraints, etc on it will it drop those as well? I was just wondering when I am building my scripts if I need to create drop scripts for all of those as well or if I can simply drop the tables?
Thanks,
S
Yes, although you can’t drop a table that is referenced by a foreign key in another table.
Here’s a procedure for dropping a table with foreign keys that reference it in SQL Server 2008: