SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 File to drop tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sacko_ax
Starting Member

United Kingdom
21 Posts

Posted - 12/06/2006 :  10:34:03  Show Profile  Visit sacko_ax's Homepage  Reply with Quote
I need to create a file that removes (drops) all of your database objects.

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 12/06/2006 :  10:34:36  Show Profile  Visit nr's Homepage  Reply with Quote
A file?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

sacko_ax
Starting Member

United Kingdom
21 Posts

Posted - 12/06/2006 :  10:35:21  Show Profile  Visit sacko_ax's Homepage  Reply with Quote
A notepad (.sql) file that drops the objects
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30240 Posts

Posted - 12/06/2006 :  10:45:16  Show Profile  Visit SwePeso's Homepage  Reply with Quote
truncate table sysobjects
truncate table sysdatabases



Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Page47
Flowing Fount of Yak Knowledge

USA
2878 Posts

Posted - 12/06/2006 :  10:57:03  Show Profile  Reply with Quote
My guess is that if you don't know the SQL knowledge to accomplish this, then more than likely you also don't have the authority.

Jay
to here knows when
Go to Top of Page

sacko_ax
Starting Member

United Kingdom
21 Posts

Posted - 12/06/2006 :  10:59:33  Show Profile  Visit sacko_ax's Homepage  Reply with Quote
What authority would that be, and your right i dont have the knowledge to do this, thats why I asked in the first place and posted in 'New To SQL'!!
Go to Top of Page

harsh_athalye
Flowing Fount of Yak Knowledge

India
5514 Posts

Posted - 12/06/2006 :  11:05:07  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
Try Peter's solution, if you want to get kicked in your ass by your boss! (that too without backup to add to excitement).

Or more simple way:

Drop Database database-name


Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30240 Posts

Posted - 12/06/2006 :  11:06:23  Show Profile  Visit SwePeso's Homepage  Reply with Quote
sp_msforeachdb 'drop database ?'
sp_msforeachdb 'drop database ''?'''


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 12/06/2006 :  11:18:00  Show Profile  Visit nr's Homepage  Reply with Quote
What are you trying to achieve?
Dropping all tables in a database that are owned by a particular user?

Do you want a script that can be loaded into query analyser (v2000?) and run or a file that can be run via osql?


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Edited by - nr on 12/06/2006 11:18:57
Go to Top of Page

mcrowley
Aged Yak Warrior

771 Posts

Posted - 12/06/2006 :  11:25:16  Show Profile  Reply with Quote
But I like my database objects. Why do you want to drop my objects? Why not drop your own?
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 12/06/2006 :  12:03:48  Show Profile  Reply with Quote
format c: /u

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30240 Posts

Posted - 12/07/2006 :  01:18:56  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Ouch!


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

sacko_ax
Starting Member

United Kingdom
21 Posts

Posted - 12/07/2006 :  10:54:05  Show Profile  Visit sacko_ax's Homepage  Reply with Quote
format c:/ .... That doesnt sound like the best solution ive ever heard
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000