Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 700
  • Last Modified:

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
0
anushahanna
Asked:
anushahanna
  • 4
  • 3
  • 2
  • +1
4 Solutions
 
dqmqCommented:
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 MatthewsCommented:
Are you using any function calls that return an int value?  Look for CONVERT, CAST, and DATEDIFF in particular...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 VijayCommented:
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
 
dqmqCommented:
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now