Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2010-08-23
10
682 Views
Last Modified: 2012-05-10
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
Comment
Question by:anushahanna
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 42

Accepted Solution

by:
dqmq earned 250 total points
ID: 33503441
Common sense + trial and error.

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

      [size_available_bytes] [int]
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33503461
thanks dqmq. I made all the int's into bigint's; still same issue.
0
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 125 total points
ID: 33503572
Are you using any function calls that return an int value?  Look for CONVERT, CAST, and DATEDIFF in particular...
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Author Comment

by:anushahanna
ID: 33503591
no, it is a straight insert-select statement. (please remove the - in the select, if you run the query).
0
 
LVL 8

Expert Comment

by:Mohit Vijay
ID: 33504357
Can you post your SQL Statement here. We can help!
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33504370
please see attached in the beginning of the post.please remove the - in the select command.
0
 
LVL 8

Assisted Solution

by:Mohit Vijay
Mohit Vijay earned 125 total points
ID: 33504449
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
 
LVL 42

Assisted Solution

by:dqmq
dqmq earned 250 total points
ID: 33504575
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
 
LVL 6

Author Comment

by:anushahanna
ID: 33504600
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
 
LVL 8

Expert Comment

by:Mohit Vijay
ID: 33507754
Is your problem solved?
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

840 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