• I think that people spend way too much on cop-like programs like this. SELECT * isn't necessarily a problem (in fact, I've seen it provide a performance improvement on occasion. "It Depends".). Nested Views and Functions aren't necessarily a problem. Cursors, While Loops, and Recursion isn't necessarily a problem. Although I hate to see it, using other than 2 part naming conventions isn't necessarily a problem.

    There are a ton of things that can appear syntactically that a lot of people might think are a problem and will show up in a lot of these cop-like programs but the one thing they don't do is determine if the things it finds are actually a problem.

    Right clicking on an instance in explorer and drill down to one or more of the performance reports is much more effective at determining if you have a performance problem and the top 10 items are. If you don't like the output from that (can't copy and paste, for example), write your own. It's just not that difficult and you'll learn something in the process.

    Don't chase ghosts or chance problems. Find the real problems and fix those.

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