• Tom

    Another reason not to use sys.syscomments and use sys.sql_modules instead (the type of the definition column of sys.sql_modules is nvarchar(max)).

    This isn't what the question is. Additionally, maybe if the question was about sys.sql_modules then you wouldn't be casting stones, as the field is called definition reather than text.

    Once again, since there is not a field for comments about the object, how can you say that comments are returned? The truth of the matter is that the definition of the object is returned, which may or may not contain comments internal to it.

    If you cannot tell the difference, then, using your words, I would not want you writing code in my shop. I couldn't afford to have you spend your day telling everyone how wrong they are over such nonsense. Obviously, you got the question wrong, yet have made up for the point.

    Steve Jimmo
    Sr DBA
    “If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan