how to convert varchar to int

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • powernet88
    New Member
    • Nov 2008
    • 3

    #1

    how to convert varchar to int

    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
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Check the limits of numeric data types here

    -- CK

    Comment

    • powernet88
      New Member
      • Nov 2008
      • 3

      #3
      Thank you very much

      ck9663,
      I got it, thank you very much!

      Comment

      Working...