>>
>>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
>>
>
>I see you already have some code for that. :)
>
>But, when I run it, I have:
>
>"Invalid object name 'INFORMATION_SCHEMA.Tables'."
You have no sp_MsForEachTable no INFORMATION_SCHEMA.Tables?
There is something wrong with installation then.
This is View with is created for each Database
Could you post your test script?
That View EXISTS in ALL versions since SQL Server 2000
What is the result of SELECT * FROM sys.Tables (this is another view but it is in SQL Server 2005 only, I think)?
If you have sys.Tables the the code could be modified:
><pre>
USE YourDataBase
DECLARE @TableName AS varchar(8000)
DECLARE @sql AS varchar(8000)
SELECT @TableName = MIN(Name) FROM sys.Tables
WHILE @TableName IS NOT NULL
BEGIN
SET @sql = 'DROP TABLE '+@TableName
EXEC (@sql)
SELECT @TableName = MIN(Name) FROM sys.Tables WHERE Name > @TableName
END
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.