Script(s)

what I learn is what u c

SQL2000 : Drop Database Contents from Query Analyzer

with one comment

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

Advertisements

Written by gchandra

February 15, 2006 at 5:27 pm

Posted in Database

One Response

Subscribe to comments with RSS.

  1. […] SQL2000 : Drop Database Contents from Query Analyzer […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: