• srienstr (1/31/2008)


    GSquared (1/31/2008)


    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.")

    The term "invalid" has a specific contextual meaning in regard to SQL which is different from the standard dictionary definition, much as the definition of "character" in SQL is much more rigid than you will find in the dictionary and "integer" is much more limited than the definition in a mathematics textbook. His usage of "valid" is both accurate and precise within the framework in which he used it.

    The only IT-specific definition of "valid" that I can find in any dictionary online is "A data-flow computer language", in which it is a proper noun.

    If we're dealing with made up words here, with no formal/accepted definition, then I can validly say that your definition of "valid" is, in fact, invalid. 🙂

    Unless, of course, you can provide a source for that "specific contextual meaning". Can you?

    (I do have actual dictionary definitions for the SQL use of words such as "integer", "character", "return", etc. Very easy to find those. "Valid", however, does not appear to have a specific SQL meaning, nor a meaning generic to anything related to error messages from code compilation/use.)

    - 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