问题描述
Hello iam使用sqlserver 2008.
Iam将table1与studentid列作为int。另一个表table12与studentntid列为id.Now我必须将数据从table1移动到table2.Before我需要检查table1中的数据是否为整数。如果它是整数,我需要允许它到table2。
我试过isnumeric(studentid ),它接受浮动也像10.0
我试过转换(studentid,int),抛出错误:无法从varchar转换为int。
感谢您的帮助
Hello iam using sqlserver 2008.
Iam having table1 with studentid column as int.And another table table12 with same studentid column as id.Now i have to move the data from table1 to table2.Before dat i need to check whether the data in table1 is integer or not.If it is integer,i need to allow it to table2.
I have tried isnumeric(studentid),it is accepting float also like 10.0
I tried with convert(studentid,int),throwing error :cannot convert from varchar to int.
Thanks for any help
推荐答案
这篇关于在SQL Server中将Varchar转换为Int Data类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!