SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Arithmetic overflow error converting varchar to da
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

alejo46
Yak Posting Veteran

Colombia
82 Posts

Posted - 06/26/2012 :  17:59:24  Show Profile  Reply with Quote
Good afernoon

i need your help

ive got this query that yilds me an error:

select CDR_NUMBER,B_NUMBER,convert(numeric(12,0) ,B_NUMBER) --as Alfanumerico
,case when isnumeric(B_NUMBER) <> 1 then 'Campo Alfanumerico' else 'Numerico' end from TEMP_ICT_DW


Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting varchar to data type numeric.


i query this firts 243 rows since in row 243 yields that error:
select top 243 CDR_NUMBER,B_NUMBER from TEMP_ICT_DW

i found a data with a non numeric data

13693 03168723841
13694 03167431143
13694 03167431143
13695 03163801808
13695 03163801808
13696 +1433115167292

1.how do i remove non numeric data like +1433115167292 ?
2. after removing non numeric ie +1433115167292 to 1433115167292 what data type supports this data ?

Id appreciate your help


jeffw8713
Aged Yak Warrior

USA
699 Posts

Posted - 06/27/2012 :  00:49:12  Show Profile  Reply with Quote
+1433115167292 can be converted as a number - but it requires at least numeric(13,0). If you have other non-numeric data add a filter to your where clause to eliminate the non-numeric values.

WHERE isnumeric(B_NUMBER) = 1
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000