SQL2000 : Drop Database Contents from Query Analyzer

U : Table
P : SP
PK : Primary Key
UQ : Unique Constraint
F : Foreign Key
FN : Functions
D : Default

To see the list of User Create Items
— SELECT * FROM sysObjects WHERE xType in (‘U’,’P’,’PK’,’UQ’,’F’,’FN’,’D’)

— Declare @sql NVarChar(4000)– Select @sql= isnull(@sql,”) +’Drop Table ‘ + Name + ‘;’ From sysObjects Where xType=’U’– Exec sp_executesql @sql

— Declare @sql NVarChar(4000)– Select @sql= isnull(@sql,”) +’Drop Proc ‘ + Name + ‘;’ From sysObjects Where xType=’P’– Exec sp_executesql @sql

— Declare @sql NVarChar(4000)– Select @sql= isnull(@sql,”) +’Drop Function ‘ + Name + ‘;’ From sysObjects Where xType=’FN’– Exec sp_executesql @sql

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: