• Lynn Pettis (3/31/2013)


    I can run the code all day long, it won't tell me what the problem is if you don't show me. I have no idea what the expected results of the query are to compare the actual results.

    Since you do not have any job history you can't test. But think about.

    I had a situation a few weeks ago when I setup up a new server and I needed to test the job notification on failure so I created a job and added a step with the sp_who3 command mistyped and I was able to successfully test the job.

    Create a job with a sp_who2 command and execute my code.

    If you do not feel like it then please disregard my post.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/