• Wouldn't a search of dependencies tell you?

    {edit} Bad suggestion on my part. :blush: Like Steve says below, it's NOT 100% guaranteed. It's always worked for me in the past but that's only because I (apparently) got lucky and followed "the rules". I knew that dynamic SQL wouldn't register but I didn't know the "fault" induced by deferred naming, etc.

    See sys.sql_dependencies in Books Online for more info on why a dependency may or may not exist.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)