将数据类型从nvarchar转换为numeric [英] conversion of data type from nvarchar to numeric

查看:1169
本文介绍了将数据类型从nvarchar转换为numeric的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下查询将列的数据类型从nvarchar更改为numeric: -

  alter   table  grimage  alter   column  tbb 数字 10 





但我收到以下错误: -

将数据类型nvarchar转换为数字时出错。< br /> 
语句已被删除终止。

解决方案





检查该列中的值因为String可能存储所以它无法转换值...如果是这样,那么更新值并更改。


嘿,如果没有检查表值,请先检查表值.Youtr表有一些文本值,所以首先删除它们之后你可以改变你的表...

要更改Column的数据类型,它应该为空。


I am trying to change the data type of a column from nvarchar to numeric by using following query:-

alter table grimage alter column tbb numeric(10)



but i got the following error :-

Error converting data type nvarchar to numeric.<br />
The statement has been terminated.

解决方案

Hi,

Check the values in that column because String might be stored so it cant convert the values...If it so then update the values and change.


Hey have u checked the table values if not please check your table values first.Youtr table has some text values defiantly so first remove them after that you can alter your table...


To change the data type of Column, it should be empty.


这篇关于将数据类型从nvarchar转换为numeric的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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