Procedure fails when called from a job

  • Hi Folks,

    I have encountered an interesting phenomenon whereby a stored procedure works flawlessly when called manually but when called from a Job Returns a fatal error:

    The conversion of the data types varchar to datetime produced a value datetime out of interval

    (I had to translate that from German so I hope it's accurate...)

    Can anyone explain why that might be? It is a SQL Server 2008R2 fully-patched machine.....

    Thanks!

    Regards,

    Kev

  • Hi,

    The Problem is resolved.

    The SQL Agent User had a different language Setting to that in the database. It was resolved by inserting SET LANGUAGE ENGLISH at the start of the script.

    Without this Setting the month and day was reversed so that the month was interpreted as the day and vice versa.

    Regards

    Kev

  • kevaburg (7/5/2016)


    Hi,

    The Problem is resolved.

    The SQL Agent User had a different language Setting to that in the database. It was resolved by inserting SET LANGUAGE ENGLISH at the start of the script.

    Without this Setting the month and day was reversed so that the month was interpreted as the day and vice versa.

    Regards

    Kev

    Thanks for the feedback with the answer, Kev. I appreciate it.

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

Viewing 3 posts - 1 through 2 (of 2 total)

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