Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing all tables
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01297747
Message ID:
01297755
Views:
25
I think you're missing TABLE_TYPE = 'BASE TABLE' WHERE condition

>
>
>USE YourDataBase
>DECLARE @TableName AS varchar(8000)
>DECLARE @sql       AS varchar(8000)
>SELECT @TableName = MIN(Table_Name) FROM INFORMATION_SCHEMA.Tables
>WHILE @TableName IS NOT NULL
>      BEGIN
>          SET @sql = 'DROP TABLE '+@TableName
>          EXEC (@sql)
>          SELECT @TableName = MIN(Table_Name) FROM INFORMATION_SCHEMA.Tables WHERE Table_Name > @TableName
>      END
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform