I want to delete total tables at time ?


i want to delete total database from MYSQL server(remove the entire table) Generally Ex: delete * from table_name; it is deleted Particular table. But I want to delete Number of table's at a time? it is Possible or Not?
more ▼

asked Oct 02, 2012 at 05:20 PM in Default

veerivirus gravatar image

0 1 1 2

You want to use one statement to delete data from multiple tables? Or you want to remove the entire table?
Oct 02, 2012 at 05:26 PM ThomasRushton ♦
Oh, and why have you mentioned MySQL in the query, but tagged your question with multiple versions of SQL Server rather than MySQL?
Oct 02, 2012 at 05:27 PM ThomasRushton ♦

re-tagged as mysql.

Please add more to your question so that we can answer your problem
Oct 02, 2012 at 09:44 PM Fatherjack ♦♦
(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first
I don't believe so. Any process that attempts to simulate this is actually running the individual DELETE statements behind the scenes. This would be true of SQL Server, too, by the way.
more ▼

answered Oct 03, 2012 at 12:50 PM

K. Brian Kelley gravatar image

K. Brian Kelley
933 2

(comments are locked)
10|1200 characters needed characters left

SQL doesn't really work like that. You basically work at an entity level... column/table/dB. Regardless of that you wouldn't see much difference execution wise between one multi-table kind of command and multiple single commands. EDIT

For removing a database you can try this:

more ▼

answered Oct 03, 2012 at 01:09 PM

Blackhawk-17 gravatar image

11.9k 28 31 37

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Oct 02, 2012 at 05:20 PM

Seen: 687 times

Last Updated: Oct 03, 2012 at 01:16 PM