SQL Agent Job returning different results to running an SP manually

  • Hi,

    I am having an issue with a scheduled job (which just executes an SP) returning different results to when I run the exact same code myself manually.

    When I run the code manually (using a sysadmin account) the results are correct, running the code via the job returns incorrect results. SQL Server Agent runs using the \.SQL Agent account and I have never noticed any problems before.

    The SP uses new 2012 windowing functions but I don't think that should be an issue? I have tried searching for similar issues but not found anything directly relevant.

    Help please it is driving me nuts!

    Regards,

    Craig

  • Craig

    Here's two possibilities:

    (1) Your account has a different default schema from the SQL Server Agent account

    (2) The environment settings are different when it runs as a job, for example SET CONCAT_NULL_YIELDS_NULL ON/OFF.

    John

  • Thanks John I will look into those and get back to you either way.

  • OK, that set me on the right track. I noticed the SQL Agent account was using English as opposed to British English. I changed that and it is now working OK.

    Thanks very much for your help!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply