Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way to drop all tables
Message
From
27/02/2008 11:50:10
 
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Miscellaneous
Thread ID:
01296633
Message ID:
01296911
Views:
7
>sp_MsForEachTable is hidden SP stored in master DB.
>
>This works for me :
>
>CREATE DATABASE Test
>GO
>USE Test
>GO
>CREATE TABLE Tbl1 (Fld1 int)
>CREATE TABLE Tbl2 (Fld1 int)
>CREATE TABLE Tbl3 (Fld1 int)
>GO
>sp_MsForEachTable 'DROP TABLE ?'
>
>Maybe you sholud try it with EXEC:
>
>EXEC sp_MsForEachTable 'DROP TABLE ?'
>
This doesn't work for me. I always have the error saying that the stored procedure is not found.

I have tried your code as is. The exact message is:

Msg 2812, Level 16, State 62, Line 1
Cound not find stored procedure 'sp_MsForEachTable'.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform