日期:2014-05-17 浏览次数:20626 次
create function dbo.f_ntof(
@n nvarchar(100)
)
returns float
as
begin
return (case when isnumeric(@n)=1 then convert(float,@n) else null end)
end
go
select dbo.f_ntof('xx'),dbo.f_ntof('20.3');
------解决方案--------------------
alter table 表名 alter column 字段名 float
------解决方案--------------------