Monday, March 19, 2012

[SQLSTATE 22003] (Error 8115)

Hi,
I have this job that runs sometimes it completes successfully, sometimes it
fails.
When it fails it gives this error message -->
--
Executed as user: sqlagent. Arithmetic overflow error converting expression
to data type int.
[SQLSTATE 22003] (Error 8115) The statement has been terminated. [S
QLSTATE
01000] (Error 3621).
The step failed.
--
When I did the research on all the codes in the error looks like one of the
statements such as -->
SELECT ABS(convert(int, -2147483648))
is causing the problem. The problem I am having is that stored procedure
that runs has many 'converts' and I do not know which one is causing the
problem. Can I setup some kind of monitor that will catch exact cause or
declared 'int' that it is unable to convert to "int"?
How should I go about it?
Thanks
-DYou can run a Profiler trace, including stored procedure statement
starting/completed and exception events. Alternatively, you can run the
proc from Query Analyzer, using the debugger to step through the code
Hope this helps.
Dan Guzman
SQL Server MVP
"D''Animal" <DAnimal@.discussions.microsoft.com> wrote in message
news:E1F085A7-C312-4989-96D4-EF2DFA1FD835@.microsoft.com...
> Hi,
> I have this job that runs sometimes it completes successfully, sometimes
> it
> fails.
> When it fails it gives this error message -->
> --
> Executed as user: sqlagent. Arithmetic overflow error converting
> expression
> to data type int.
> [SQLSTATE 22003] (Error 8115) The statement has been terminated.
> [SQLSTATE
> 01000] (Error 3621).
> The step failed.
> --
> When I did the research on all the codes in the error looks like one of
> the
> statements such as -->
> SELECT ABS(convert(int, -2147483648))
> is causing the problem. The problem I am having is that stored procedure
> that runs has many 'converts' and I do not know which one is causing the
> problem. Can I setup some kind of monitor that will catch exact cause or
> declared 'int' that it is unable to convert to "int"?
> How should I go about it?
> Thanks
> -D
>

No comments:

Post a Comment