Finding the column with Arithmetic overflow error converting expression to data type int.

In the attached code, I am getting the error

Msg 8115, Level 16, State 2, Line 2
Arithmetic overflow error converting expression to data type int.

after getting the values for 20 rows.

are you able to get an idea which column gives the error with the error message?

thanks
spspaceused.txt
LVL 6
anushahannaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
dqmqConnect With a Mentor Commented:
Common sense + trial and error.

Focus on int columns that you are making bigger.  Like this one:

      [size_available_bytes] [int]
0
 
anushahannaAuthor Commented:
thanks dqmq. I made all the int's into bigint's; still same issue.
0
 
Patrick MatthewsConnect With a Mentor Commented:
Are you using any function calls that return an int value?  Look for CONVERT, CAST, and DATEDIFF in particular...
0
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.

 
anushahannaAuthor Commented:
no, it is a straight insert-select statement. (please remove the - in the select, if you run the query).
0
 
Mohit VijayCommented:
Can you post your SQL Statement here. We can help!
0
 
anushahannaAuthor Commented:
please see attached in the beginning of the post.please remove the - in the select command.
0
 
Mohit VijayConnect With a Mentor Commented:
Run only Select Statement, If it is returning results, check columns, it should be compitable data with your tmp_size table. take extra eye on int and bigint column. It might be possible that your select statement is returning values that is not be convertible in int, bigint.
0
 
dqmqConnect With a Mentor Commented:
May need to comment out half the columns and retry.  Continue to narrow it down that way.  That's what I meant by trial and error.

There's also a remote possibility the error occurs while joining, but I can't see how.
0
 
anushahannaAuthor Commented:
OK. I expanded the numeric columns and also used bigint, so it was probably one of those columns- thanks for the hint and idea.

appreciate you experts.
0
 
Mohit VijayCommented:
Is your problem solved?
0
All Courses

From novice to tech pro — start learning today.