• Unless you get incredibly sophisticated with your search algorithms, possibly using CLR or something, to determine if the string you're looking at is contained within a comment, of either type, line comments or block comments, no, there's no way to do this with a straight-forward T-SQL statement.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning