MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.


Tutorials
| Forums

Download to Enter
| Contest Rules

DOWNLOAD INTEL® GPA FOR FREE

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 30th, 2008, 03:34 PM
sean_micken sean_micken is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 33 sean_micken User rank is Corporal (100 - 500 Reputation Level)sean_micken User rank is Corporal (100 - 500 Reputation Level)sean_micken User rank is Corporal (100 - 500 Reputation Level)sean_micken User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 12 h 5 m
Reputation Power: 8
Send a message via MSN to sean_micken
DELETE FROM vs. DROP TABLE

I want to get rid of a huge table. DELETE FROM would take for-freaking-ever, so I was thinking of doing DROP TABLE. Would this be any faster?

If not, would doing a TRUNCATE TABLE and then DROP TABLE be fast? What's the best way to nuke a big table?

Thanks.

Reply With Quote
  #2  
Old January 30th, 2008, 05:41 PM
marnixR's Avatar
marnixR marnixR is offline
i don't do negative rep
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2006
Posts: 757 marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level)marnixR User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 14 h 19 m 30 sec
Reputation Power: 703
Facebook
you DO realise that DROP TABLE deletes the complete table, whereas DELETE only deletes the content ?
__________________
admin of Philosophorum - now in its sixth year and still as modest as ever (although now also looking uncharacteristically professional + snazzy after the latest upgrade)

some character references
universally acclaimed as "fundie of the worst kind"
"the stubborn old loser whose high point of the day is making immature remarks and counting his rep points on an internet message board"
stop bitching about lower case - it's my trademark™

Reply With Quote
  #3  
Old January 30th, 2008, 05:59 PM
sean_micken sean_micken is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 33 sean_micken User rank is Corporal (100 - 500 Reputation Level)sean_micken User rank is Corporal (100 - 500 Reputation Level)sean_micken User rank is Corporal (100 - 500 Reputation Level)sean_micken User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 12 h 5 m
Reputation Power: 8
Send a message via MSN to sean_micken
Yes, I do realize that. I want to clear out a huge table and I'm trying to find a quick way to do it.

DELETE FROM would take too long and so if DROPing the table and then re-creating it is faster, that's fine with me. I just want to get rid of the data.

TRUNCATE TABLE is a quick way to delete rows from a table, but it doesn't actually remove the data. I need to way to REMOVE all that data the quickest way possible.

Reply With Quote
  #4  
Old January 31st, 2008, 12:56 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 24,743 r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level)r937 User rank is General 42nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Day 10 h 40 m 26 sec
Reputation Power: 3826
Quote:
Originally Posted by sean_micken
TRUNCATE TABLE is a quick way to delete rows from a table, but it doesn't actually remove the data.
oh? the rows are deleted, but they're not actually removed?

perhaps you ought to follow up the TRUNCATE TABLE statement with the REMOVE ROWS statement if you're still concnerned about them


__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
  #5  
Old January 31st, 2008, 01:17 AM
sean_micken sean_micken is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 33 sean_micken User rank is Corporal (100 - 500 Reputation Level)sean_micken User rank is Corporal (100 - 500 Reputation Level)sean_micken User rank is Corporal (100 - 500 Reputation Level)sean_micken User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 12 h 5 m
Reputation Power: 8
Send a message via MSN to sean_micken
Hahaha... funny ;p

Last edited by sean_micken : January 31st, 2008 at 02:02 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > DELETE FROM vs. DROP TABLE


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap