By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,806 Members | 1,841 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,806 IT Pros & Developers. It's quick & easy.

how to convert varchar to int

P: 3
there is a varchar column named emp_ref_no and it's length 20, I tried to convert it into int

select cast(emp_ref_no as int)
from tables
where isnumeric( emp_ref_no ) =1

however I got error message:

The conversion of the varchar value '133261280299' overflowed an int column. Maximum integer value exceeded.

Is anyone can help? many thanks
Nov 21 '08 #1
Share this Question
Share on Google+
2 Replies


ck9663
Expert 2.5K+
P: 2,878
Check the limits of numeric data types here

-- CK
Nov 21 '08 #2

P: 3
ck9663,
I got it, thank you very much!
Nov 23 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.