Solved

Arithmetic overflow error

Posted on 2006-11-22
3
1,242 Views
Last Modified: 2008-02-01
For the 2 stored procedures I am getting the same error in different lines with similar condition.
 
In storedprocedure1   I am getting the   SET @Flag1 = @Flag1 + 1  where it is DECLARE @Flag1 TINYINT

Server: Msg 220, Level 16, State 2, Procedure uspBatchClientHierarchy, Line 100
Arithmetic overflow error for data type tinyint, value = 256.



In storedprocedure2  I am getting the   SET @Flag2 = @Flag2 + 1  where it is DECLARE @Flag2 SMALLINT

Server: Msg 220, Level 16, State 2, Procedure uspBatchClientHierarchy, Line 150
Arithmetic overflow error for data type tinyint, value =  32768
0
Comment
Question by:Richards
  • 2
3 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17994040
Hi Richards,


change the datatype of @flag1 to int , tiny int can store upto 255



Cheers!
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 125 total points
ID: 17994042
also do the same with @flag2 , change it as int
0
 
LVL 28

Expert Comment

by:imran_fast
ID: 17995545
try print @flag1,@flag2
to check what is the value it reached at the time of error. may be you need to initialize the value
set @flag1 = 0
after some iteration

other wise as aneesh suggested change datatype to int
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question