March 21, 2008 at 10:02 am
HI
I am on SQL 2000 Query anaylzer and on my SP I have a Cursor with a huge Dynamic SQL statement in it and @SQL is Varchar(8000). If I run with 1 row of Data I did not get any error but If I have multiple rows I am getting the error below. Please advise. Thanks.
Arithmetic overflow error converting numeric to data type numeric
March 21, 2008 at 3:40 pm
When you say it works for 1 row do you mean that it works for any 1 row or one row in particular? It may be that one of the values in the rows you are selecting is throwing you off. Try isolating the row that causes the error. Since you mentioned the length of your @sql variable, are you building the string so that it handles several rows at a time or something like "select * from x where A select * from y where B" and possibly cutting off the statements? Depending on where the cut happens you may have a runnable sentence that is missing something you need.
March 21, 2008 at 11:50 pm
Hi ksullivan
I resolved my own problem by narrowing down that row that had given me problem and I found out the Dynamic sql has a case statement that has integer condition and return a string value that caused the error. Thanks for your help.
March 22, 2008 at 8:04 am
You're welcome. Good to hear you fixed it.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply