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

[...] SQL2000 : Drop Database Contents from Query Analyzer [...]
SQL Server 2005 : Verify table already exists « using …
October 21, 2009 at 12:36 am