Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Arithmetic overflow error converting nvarchar to d

Author  Topic 

shiyam198
Yak Posting Veteran

94 Posts

Posted - 2010-03-29 : 22:12:23
I am getting this error - "Arithmetic overflow error converting nvarchar to data type numeric, when I am running the sql script.

select comment_note, Customer_No, customer_id
from AspenData.dbo.Customerslimitedbydate with(nolock)
left join AspenShowProdMar29.dbo.ts_customer with(nolock)
on AspenData.dbo.Customerslimitedbydate.customer_no = AspenShowProdMar29.dbo.ts_customer.customer_reference_code
where (CAST(AspenData.dbo.Customerslimitedbydate.comment_note AS nvarchar(4000)) <> '') and (CAST(AspenData.dbo.Customerslimitedbydate.comment_note AS nvarchar(4000)) is not null)


Not sure what is causing this error.
Any help is much appreciated.

- Shiyam

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-03-29 : 22:18:43
check your query where you are comparing a string data type to a numeric data type

most probably this
on AspenData.dbo.Customerslimitedbydate.customer_no = AspenShowProdMar29.dbo.ts_customer.customer_reference_code


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-29 : 22:19:49
Is one of these numeric/decimal and the other nvarchar: AspenData.dbo.Customerslimitedbydate.customer_no = AspenShowProdMar29.dbo.ts_customer.customer_reference_code
?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-29 : 22:20:29


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -