Solved

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

Posted on 2010-08-23
10
678 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

770 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