Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing all tables
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01297747
Message ID:
01297761
Vues:
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
>>
In Custom database?
But you are right, better be save.

I'm stuck right now. What could be the problem with Michele's SQL Server? He can't execute sp_ForEachTable SP, can't use sys.Tables or INFORMATION_SCHEMA.Tables Views.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform