在SQL Server中将varchar转换为bigint时发生转换错误 [英] conversion error while converting varchar to bigint in sql server

查看:115
本文介绍了在SQL Server中将varchar转换为bigint时发生转换错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,



select ISNUMERIC('149972,')

out put:
1

select ISNUMERIC('149972=')





out put:
0



在这里先出来显示1,然后再出来显示0

是吗,是否也包含在int中

谢谢
ramesh.m



here in first out put it show 1 and second out put it show 0

is it , is also include in int or not

Thanks
ramesh.m

推荐答案

根据MSDN上的定义:当输入表达式计算为有效数值数据类型时,ISNUMERIC返回1.有效数值数据类型包括以下内容:
int,数值,bigint,货币,smallint,smallmoney,tinyint,浮点数,十进制,实数"

Money中允许使用逗号,因此它返回1.如果在输入中加上+,-£等,它也会返回1.

http://msdn.microsoft.com/en-us/library/ms186272.aspx [ ^ ]

希望能有所帮助.如果是这样,请将其标记为答案/赞.
谢谢
Milind
According to definition on MSDN: "ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type. Valid numeric data types include the following:
int, numeric, bigint, money, smallint, smallmoney, tinyint, float, decimal, real"

Comma is allowed in Money, hence it is returning 1. It will also return 1 if you +, - £ etc signs in the input.

http://msdn.microsoft.com/en-us/library/ms186272.aspx[^]

Hope that helps. If it does, mark it as answer/upvote.
Thanks
Milind


查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆