Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Unanswered: Problem running Proc from Job

    I have a stored procedure that runs fine using the Query Analyzer:

    exec sp_ProcessRecords

    However, when I create a job to run the stored proc once an hour, the job fails, with the following message:

    Executed as user: sa. String or binary data would be truncated. [SQLSTATE 22001] (Error 8152) The statement has been terminated. [SQLSTATE 01000] (Error 3621). The step failed.

    I don't think it's a permission problem, since the job runs as sa.

    I don't understand why it would work if I run it manually, but not when it runs as a job.

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    Check your parameters that are being passed to the stored procedure. This means that some parameter that is being passed it too long for the datatype and will be truncated.

  3. #3
    Join Date
    Dec 2003
    Posts
    2
    Originally posted by rnealejr
    Check your parameters that are being passed to the stored procedure. This means that some parameter that is being passed it too long for the datatype and will be truncated.
    Unfortunately, the stored proc called from the job does not take any parameters.

    The odd thing is that the stored proc will work fine if it is run manually from the Query Analyzer. The error only occurs when the proc is run from the job, using the exact syntax!

    I'm at a loss...

  4. #4
    Join Date
    Feb 2002
    Posts
    2,232
    Can you post the stored proc code - or describe what it is doing ? If you are doing inserts/updates then the same problem can occur.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •