Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-10-14
5
Medium Priority
?
246 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 1600 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 400 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Integration Management Part 2
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

824 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