declare @t table(a varchar(10))
insert into @t
select '1234' union all
select '5678' union all
select 'ffff' union all
select 'f456' union all
select '9876'
select * from @t
select a as '原数据' ,'转换后数据'= case when isnumeric(a)=1 then convert(numeric(9,4),a) else 0.0 end from @t
/*
(所影响的行数为 5 行)
a
----------
1234
5678
ffff
f456
9876
(所影响的行数为 5 行)
原数据 转换后数据
---------- -----------
1234 1234.0000
5678 5678.0000
ffff .0000
f456 .0000
9876 9876.0000
(所影响的行数为 5 行)
*/