34,590
社区成员
发帖
与我相关
我的任务
分享
--先检查下字符的数据,确认无误后然后用楼上的更新语句,防止业务数据搞坏....
select 合计金额 from SHBSJ where isnumeric(合计金额)=0
use TEST
go
CREATE TABLE T
(
ID int identity(1,1)
,金额 char
)
alter table t alter column 金额 money
insert into t (金额)
select 23
union all
select 34
union all
select 53
select * from t
--因你有的列的值不是合法的money类型,money类型还真没用过,试下
update SHBSJ set 合计金额=0 where isnumeric(合计金额)=0
alter table SHBSJ alter column 合计金额 money null