Solved

The conversion of the varchar value overflowed an int column overflowed an int column

Posted on 2013-01-28
4
1,573 Views
Last Modified: 2013-02-12
I have a query something like below

select name from school where school_id in (46, 244, 200)

but the query returns the following error

Msg 248, Level 16, State 1, Line 1
The conversion of the varchar value '00000000000000020000000104000000040000011800004008000008' overflowed an int column.


my school_id data type is

varch(64)
0
Comment
Question by:wasabi3689
[X]
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
  • 3
4 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 350 total points
ID: 38829082
That's a mighty big honkin' number.

The range of an int is  -2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647), which the number above went past by a couple of billion.
 
int, bigint, smallint, and tinyint (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms187745.aspx

>my school_id data type is varch(64)
The IN clause likely did an implicit conversion to integers, since the numbers do not have varchar delimeters ' ' around them.  Explain for us what you're trying to pull of with the IN.
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38829107
Let me know if this works...

select name
from school
where school_id like '%46%'
   OR school_id like '%244%'
   OR school_id like '%200%'
0
 

Author Closing Comment

by:wasabi3689
ID: 38879005
good
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38879908
Thanks for the PAQ, but if you needed any clarifications you could have asked for them, so a B grade is not warranted here.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

628 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