Solved

Insert/Update/Delete Or Drop Table/Create Table/Insert Or Drop Table/Select Into

Posted on 2008-10-14
5
187 Views
Last Modified: 2012-05-05
Is it better to Insert/Update/Delete Or Drop Table/Create Table/Insert Or Drop Table/Select Into?
0
Comment
Question by:pat_cunningham
5 Comments
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 400 total points
Comment Utility
That depends on what you're doing.

I usually avoid dropping tables ... but that's largely preference.  If you absolutely don't need the data back that you're deleting, you can TRUNCATE TABLE to be more efficient than doing a DELETE.
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
Comment Utility
The only answer is:

Yes, unless it's no.

There is no way to answer that question without knowing more.

How big of a table?
Indexes?
How often?

These are just SOME of the answers.
0
 
LVL 60

Expert Comment

by:chapmandew
Comment Utility
My question is....what are you trying to do?
0
 

Author Comment

by:pat_cunningham
Comment Utility
It is a large query that I run several times a day and dump into a table.  The table on has 225 rows and 50 columns but the query takes a while and the data is used on a webpage so I put it into a table to speed things up.
0
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 100 total points
Comment Utility
have you tried to truncate the table first and then load it...truncating a table takes far less time than deleting...but since it is only 225 records, either way would be pretty speedy.

dont' delete, as you lose any permissions on the table.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now