Solved

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

Posted on 2008-10-14
5
208 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
ID: 22715078
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
ID: 22715084
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
ID: 22715098
My question is....what are you trying to do?
0
 

Author Comment

by:pat_cunningham
ID: 22715127
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
ID: 22715431
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
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 Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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