Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
laddu
Constraint Violating Yak Guru
332 Posts |
Posted - 2010-11-03 : 13:39:15
|
Is there an easy way to drop all tables in a database from management studio. I am using SQL 2005 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2010-11-03 : 13:51:50
|
Another way is to use object explorer to right click the database and select tasks | generate sql script. then go through the options. you can de-select "include create" and select "include drop". The constraints will be handled accordingly.Be One with the OptimizerTG |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2010-11-04 : 08:19:15
|
Yet another way:exec sp_msforeachtable 'DROP TABLE ?'As Tara mentioned you'll get errors if there are foreign keys, but multiple runs will drop them all. |
 |
|
|
|
|