|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,040,
Visits: 1
|
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Tuesday, June 04, 2013 7:03 AM
Points: 4,443,
Visits: 7,249
|
|
Can we have more questions where the answer is in the title of the question!
John
|
|
|
|
|
Mr or Mrs. 500
      
Group: Administrators
Last Login: 2 days ago @ 9:24 AM
Points: 511,
Visits: 948
|
|
| It would certainly help my average! Seriously though, apologies for the mistakes made in today's and yesteday's QoDs. Tony.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, January 06, 2012 2:39 PM
Points: 954,
Visits: 683
|
|
| I thought it had to be some sort of trick question. (Halloween and all). :)
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 5:24 AM
Points: 1,028,
Visits: 759
|
|
Surely drop table is quicker?
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Friday, June 07, 2013 12:02 PM
Points: 2,007,
Visits: 6,043
|
|
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
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Tuesday, June 04, 2013 7:03 AM
Points: 4,443,
Visits: 7,249
|
|
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.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: 2 days ago @ 10:19 AM
Points: 1,910,
Visits: 1,606
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 12:53 AM
Points: 1,130,
Visits: 1,276
|
|
gr8 question with the answer in the title itself
|
|
|
|