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 12345»»»

TRUNCATE in TRANSACTION Expand / Collapse
Author
Message
Posted Monday, January 3, 2011 10:22 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, October 16, 2014 4:19 AM
Points: 1,907, Visits: 580
Comments posted to this topic are about the item TRUNCATE in TRANSACTION

-----------------
Gobikannan
Post #1042152
Posted Monday, January 3, 2011 11:05 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Wednesday, October 1, 2014 10:48 AM
Points: 4,126, Visits: 3,427
Gee, lots of code but actually very simple -- thanks!
Post #1042163
Posted Monday, January 3, 2011 11:24 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Friday, October 17, 2014 12:53 PM
Points: 4,012, Visits: 5,305
Good question,
missed the where, so got it wrong....
lesson - read carefully....


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1042171
Posted Tuesday, January 4, 2011 12:04 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:25 AM
Points: 13,238, Visits: 11,010
Good question, but with lots of trickery.
What point were you trying to make? Duplicates with UNION, TRUNCATE in transaction or columns referenced directly in the IN clause?




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1042180
Posted Tuesday, January 4, 2011 12:04 AM


Default port

Default portDefault portDefault portDefault portDefault portDefault portDefault portDefault port

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 4:53 AM
Points: 1,433, Visits: 1,845
Good question.

That being said, I fail to understand what the purpose of the question was - to test whether or not the user notices the "UNION", or that TRUNCATE can actually participate in a transaction.

The fact that TRUNCATE can participate in a transaction is something that not many people know when asked to list down the differences between a DELETE and a TRUNCATE.

By mixing up the "UNION" test and the TRUNCATE test, the question does draw the attention of the reader away from the important concept.

All in all, good effort, but most people will continue to have the misconception that TRUNCATEs cannot participate in a transaction even after reading and answering correctly to this question.


Thanks & Regards,
Nakul Vachhrajani.
http://nakulvachhrajani.com
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
Post #1042181
Posted Tuesday, January 4, 2011 12:11 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Sunday, June 29, 2014 11:26 PM
Points: 1,481, Visits: 1,960
Koen (da-zero) (1/4/2011)
Bad question, with lots of trickery.
What point were you trying to make? Duplicates with UNION, TRUNCATE in transaction or columns referenced directly in the IN clause?


There fixed it for you. Or well... to more suite my opinion

/T
Post #1042187
Posted Tuesday, January 4, 2011 12:25 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:25 AM
Points: 13,238, Visits: 11,010
Oh yeah, a tip for the author:
if you really want to deceive people, you should've included the number of rows that had a 3 in the answer. Eight rows I think it was. I was looking for the answer with 8 rows, but since it wasn't there, it got me thinking...





How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1042195
Posted Tuesday, January 4, 2011 2:39 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:07 AM
Points: 6,040, Visits: 8,322
I replied wrong - I saw the rollback after the truncate, assumed the question intended to test my understanding that a truncate can be rolled back, and then replied. I had not seen the missing ALL after the UNION operators, nor noticed the duplicate row.

The knowledge tested is good, but the way the question has been built suggests to me that the author tried to trick people into overlooking key elements. It would have been better to make two questions, one about rolling back after truncate table (with no other elements to confuse the reader), and one that uses UNION and inserts a duplicate row (again, with no other elements to distract the reader).



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1042248
Posted Tuesday, January 4, 2011 3:02 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 24, 2013 9:59 PM
Points: 1,354, Visits: 1,299
Hugo Kornelis (1/4/2011)
I replied wrong - I saw the rollback after the truncate, assumed the question intended to test my understanding that a truncate can be rolled back, and then replied. I had not seen the missing ALL after the UNION operators, nor noticed the duplicate row.

The knowledge tested is good, but the way the question has been built suggests to me that the author tried to trick people into overlooking key elements. It would have been better to make two questions, one about rolling back after truncate table (with no other elements to confuse the reader), and one that uses UNION and inserts a duplicate row (again, with no other elements to distract the reader).


Exactly the same thing that I did. I looked at the subject of the QOTD and it said "TRUNCATE in TRANSACTION." I did notice it didn't say UNION ALL which I always do myself but I didn't scrutinize it enough to check for duplicates because I assumed I was being tested on the TRUNCATE command.
Post #1042255
Posted Tuesday, January 4, 2011 3:19 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 4:43 AM
Points: 1,130, Visits: 1,391
cengland0 (1/4/2011)
Hugo Kornelis (1/4/2011)
I replied wrong - I saw the rollback after the truncate, assumed the question intended to test my understanding that a truncate can be rolled back, and then replied. I had not seen the missing ALL after the UNION operators, nor noticed the duplicate row.

The knowledge tested is good, but the way the question has been built suggests to me that the author tried to trick people into overlooking key elements. It would have been better to make two questions, one about rolling back after truncate table (with no other elements to confuse the reader), and one that uses UNION and inserts a duplicate row (again, with no other elements to distract the reader).


Exactly the same thing that I did. I looked at the subject of the QOTD and it said "TRUNCATE in TRANSACTION." I did notice it didn't say UNION ALL which I always do myself but I didn't scrutinize it enough to check for duplicates because I assumed I was being tested on the TRUNCATE command.
Same with me
Question is good but title is misleading.
I got it wrong but I like the way author wrote WHERE condition - value IN (column1, column2).


Thanks
Post #1042263
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse