Solved

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

Posted on 2008-10-14
5
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
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…

752 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