|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 2:31 AM
Points: 1,388,
Visits: 462
|
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 5:32 PM
Points: 3,508,
Visits: 2,588
|
|
| Gee, lots of code but actually very simple -- thanks!
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, June 13, 2013 9:46 AM
Points: 3,157,
Visits: 4,341
|
|
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”
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 6:30 AM
Points: 9,410,
Visits: 6,495
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, June 10, 2013 6:56 AM
Points: 1,282,
Visits: 1,613
|
|
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://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx Be courteous. Drive responsibly.
Follow me on Twitter: @nakulv_sql Google Plus: +Nakul
|
|
|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 3:15 AM
Points: 1,479,
Visits: 1,943
|
|
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
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 6:30 AM
Points: 9,410,
Visits: 6,495
|
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:32 PM
Points: 5,293,
Visits: 7,229
|
|
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
|
|
|
|
|
Ten 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.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 7:11 AM
Points: 877,
Visits: 1,159
|
|
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
|
|
|
|