• Shawn Melton (12/1/2010)


    I don't see the confusion on why the only acceptable answer would be the 3rd option. Of course I might think differently than others.

    I didn't see any confusion other than that many people don't understand the meaning of "all of the above" until I saw your comment.

    1) Retrieves the name of stored procedures which consists the text 'order' in the definition.-The query does not retrieve stored procedures it retrieves "each" object within sys.syscomments that the liking of "orders" in the definition.

    So you think that the definition of a stored procedure doesn't contain its name? That strikes me as real confusion! Unless you read "consists" as "consists of" rather than as "contains" (in which case the answer is "none of the above", if you are consistent and read it that way in each of the first three options, so I would still think you were confused).

    2) Retrieves the name of view, rule, default, trigger, CHECK constraint, DEFAULT constraint, and stored procedures which consists the text 'order' in the comments.

    - What does the "text" column hold...according to BOL "The text column contains the original SQL definition statements." If I create a procedure with just blocked comments in it, yes it consists of comments, but those comments are the definition of that object. At least in my mind that is how I read it.

    So do you think that the text field doesn't contain any comments that are included in the object definition, or do you think that the LIKE operator somehow skips the comments in the definition unless the definition consists of nothing but comments? It must be one or the other! That's definitely confusion.

    Tom