Runtime Error: Arithmetic overflow error converting expression to data type INT

I try to run one of the stored procedure I created long time ago by taking out the whole stored procedure and run it in SQL Query Analysis. (In this case I do not need to save the Stored procedure and run it on different query analysis to check the output …etc)
I just re-declare the parameter.
DECLARE @i INT
SET @i =20090202000000
When I run the stored procedure it returns the following error in few minutes after. (my query is going to retrieve 7 millions row and insert it into another table)
“Runtime Error: Arithmetic overflow error converting expression to data type int”
I have check/test it several time, it still return the same error.
Will it something caused by the Parameter?
Finally I check the data type of the parameter of my stored procedure; the data type is BigInt instead of Int.
I just realise I made a silly mistake.
But I can learn from mistake. If i receive the same error message “Runtime Error: Arithmetic overflow error converting expression to data type int”
The first thing I am going to do is to check the data type/value of my variable.
And make sure the size of the parameter is large enough for the value…
HaHa.

Leave a Reply