Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Truncate Table Expand / Collapse
Author
Message
Posted Tuesday, October 23, 2007 9:49 PM
SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,039, Visits: 1
Comments posted to this topic are about the item Truncate Table
Post #414168
Posted Wednesday, October 24, 2007 1:46 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:55 AM
Points: 5,233, Visits: 9,463
Can we have more questions where the answer is in the title of the question!

John
Post #414241
Posted Wednesday, October 24, 2007 4:16 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: Administrators
Last Login: Tuesday, July 8, 2014 9:43 AM
Points: 569, Visits: 1,009
It would certainly help my average!

Seriously though, apologies for the mistakes made in today's and yesteday's QoDs.


Tony.

Post #414302
Posted Wednesday, October 24, 2007 6:54 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, January 6, 2012 2:39 PM
Points: 954, Visits: 683
I thought it had to be some sort of trick question. (Halloween and all). :)
Post #414397
Posted Monday, October 29, 2007 12:31 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 3:07 AM
Points: 1,060, Visits: 876
Surely drop table is quicker?


Post #416172
Posted Tuesday, October 30, 2007 9:41 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, July 11, 2014 10:29 PM
Points: 2,007, Visits: 6,077
I do not believe that the answer is correct.

The question was the fastest way to delete every row in a table.
Delete and truncate are not the same thing.

Should the question have read "to remove all rows from a table" then I would agree with the truncate statement.
This does not take into account things like identity values which would continue from the most recent number rather than completely reseed post truncate.




Shamless self promotion - read my blog http://sirsql.net
Post #416603
Posted Tuesday, October 30, 2007 9:49 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:55 AM
Points: 5,233, Visits: 9,463
Nicholas Cain (10/30/2007)
I do not believe that the answer is correct.

The question was the fastest way to delete every row in a table.
Delete and truncate are not the same thing.

Should the question have read "to remove all rows from a table" then I would agree with the truncate statement.
This does not take into account things like identity values which would continue from the most recent number rather than completely reseed post truncate.


The question doesn't take that into account, therefore nor should your answer. DELETE and TRUNCATE do indeed work differently, but both have the effect of deleting all rows. I can't see the difference between "delete every row in a table" and "remove all rows from a table".

John

Edit: actually, having looked at the choices again, neither of the DELETE options has correct syntax anyway.
Post #416612
Posted Wednesday, April 2, 2008 5:26 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, July 3, 2014 4:00 PM
Points: 2,038, Visits: 1,663
Hmm - dropping the table is the fastest way as it logs the least and doesn't take any locks, compared to truncate table. I think that was a bad question as the answer they wanted was truncate - drop shouldn't have been an option.

Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
Post #478365
Posted Wednesday, November 28, 2012 12:29 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, July 25, 2014 12:34 AM
Points: 1,888, Visits: 2,326
gr8 question with the answer in the title itself


_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1389536
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse