• PJ_SQL (12/5/2016)


    I have a job which runs SQL Script along with function which has started to run slow.

    But when run the same query in the SSMS, it runs fine.

    What could be the reason?

    Could be any of a thousand reasons. Some of them could be quite simple. For example, does the job run at a different time of day than when you run it in SSMS?

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