简体   繁体   English

SQL Server 2012将数据类型varchar转换为数值时出错

[英]SQL Server 2012 Error converting data type varchar to numeric

I have a very big view that uses many tables and other views. 我有一个很大的视图,它使用许多表和其他视图。 When I select * from this big view, I get an error 当我从这个大视图中选择*时,出现错误

error converting data type varchar to numeric 将数据类型varchar转换为数值时出错

The problem is I don't know where exactly it happens. 问题是我不知道它到底发生在哪里。 Do I have to drill into all the involved objects, or there is a way to know where exactly is the problem? 我是否必须深入研究所有涉及的对象,还是有办法知道问题出在哪里?

it could also be a function like: 它也可能是一个像这样的函数:

declare @pippo numeric
set @pippo=null
select ISNULL(@pippo, 'x')

this will raise same conversion error 这将引发相同的转换错误

hope this help 希望这个帮助

Take the definition of the view, and make it into a SELECT statement. 获取视图的定义,并将其放入SELECT语句中。 Then remove half the columns and run it, keep removing columns until the problem goes away. 然后取出一半的色谱柱并运行,继续除去色谱柱,直到问题消除。 If it goes away, then add them back until you find the problem. 如果消失,则将它们重新添加,直到找到问题。 If it doesn't go away, then the problem is in a join. 如果没有解决,那么问题就出在联接中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL Server:将数据类型varchar转换为数值时出错 - SQL Server: error converting data type varchar to numeric 在SQL Server中将varchar转换为数值类型的算术溢出错误 - Arithmetic overflow error converting varchar to data type numeric in SQL Server 在sql server中将数据类型varchar转换为数字时出错 - Error converting data type varchar to numeric in sql server 在SQL Server 2008中将数据类型varchar转换为数值时出错 - Error converting data type varchar to numeric in sql server 2008 在SQL Server中将varchar转换为数据类型数值的算术溢出错误 - Arithmatic overflow error converting varchar to data type numeric in sql server SQL - 将数据类型varchar转换为数字时出错 - SQL - Error converting data type varchar to numeric 在SQL中将数据类型varchar转换为数字时出错 - Error converting data type varchar to numeric in SQL 如何修复 SQL 错误“将数据类型 varchar 转换为数字时出错”? - How to fix the SQL error "Error converting data type varchar to numeric"? “使用VBA将数据从Excel导出到SQL Server时,将数据类型varchar转换为数字时出错” - “Error converting data type varchar to numeric” when I export data from Excel to SQL Server using VBA 如何解决SQL Server中的“将varchar转换为数据类型数值的算术溢出错误”错误? - How to solve “Arithmetic overflow error converting varchar to data type numeric” error in sql server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM