Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way to drop all tables
Message
From
27/02/2008 04:51:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
27/02/2008 02:56:25
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Miscellaneous
Thread ID:
01296633
Message ID:
01296758
Views:
6
>>You could use sp_MSForEachTable:
>>
>>USE YourDataBase
>>sp_MsForEachTable 'DROP TABLE ?'
>>
>
>Should I just type the 2nd line as is in the Query window? The database is already the default. When I tried that, it says "Could not find stored procedure 'sp_MsforEachTable'.

It exists in SQL2005 and later, probably you're using 2000.
I think just adding a "if exists ... Drop Table" line before each create would do it just fine.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform