• I disagree with the point about the transactions.

    Dictionary definition of "valid": "well based or logical" (Compact Oxford English Dictionary, as referenced on http://www.onelook.com).

    Doing a transaction and rollback on a table variable is very much not well based or logical, since it does not do what one would probably expect. Since there are no other actions in the "transaction", the code makes no sense if one knows that it won't do anything.

    If the intention of the question was, "Which of these will raise errors or fail to compile?", then the answers given would be correct, since it won't raise an error. But I certainly don't consider wrapping an insert into a table variable in a transaction to be "valid" code. If raising errors was the intent of the question, then it should have said that and avoided the word "valid".

    (I feel like Inigo in "The Princess Bride": "I do not think that word means what you think it means.")

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon