Use Buh
਍椀昀 攀砀椀猀琀猀 ⠀猀攀氀攀挀琀 ⨀ 昀爀漀洀 搀戀漀⸀猀礀猀漀戀樀攀挀琀猀 眀栀攀爀攀 椀搀 㴀 漀戀樀攀挀琀开椀搀⠀一✀嬀搀戀漀崀⸀嬀昀开䌀栀攀挀欀一甀洀戀攀爀崀✀⤀ 愀渀搀 砀琀礀瀀攀 椀渀 ⠀一✀䘀一✀Ⰰ 一✀䤀䘀✀Ⰰ 一✀吀䘀✀⤀⤀ഀഀ
drop function [dbo].[f_CheckNumber]
਍䜀伀ഀഀ

਍匀䔀吀 儀唀伀吀䔀䐀开䤀䐀䔀一吀䤀䘀䤀䔀刀 伀䘀䘀 ഀഀ
GO
਍匀䔀吀 䄀一匀䤀开一唀䰀䰀匀 伀䘀䘀 ഀഀ
GO
਍ഀഀ
CREATE function dbo.f_CheckNumber (@str varchar(50))
਍爀攀琀甀爀渀猀 瘀愀爀挀栀愀爀⠀㔀　⤀ഀഀ
as
਍戀攀最椀渀ഀഀ
  declare @a int, @i int,@str1 varchar(50)
਍  搀攀挀氀愀爀攀 䀀猀 瘀愀爀挀栀愀爀⠀㄀⤀ഀഀ
  set @str1=''
਍  猀攀琀 䀀愀 㴀 䰀攀渀⠀䀀猀琀爀⤀ ഀഀ
  set @i = 1	
਍  眀栀椀氀攀 䀀椀 㰀㴀 䀀愀ഀഀ
  begin
਍   猀攀琀 䀀猀 㴀 匀甀戀猀琀爀椀渀最⠀䀀猀琀爀Ⰰ䀀椀Ⰰ㄀⤀  ഀഀ
   if (IsNumeric(@s) = 1) and ( (@s <> '.') and  (@s <> ',') and (@s<>' ')and (@s<>'-') and (@s<>'+') )
਍  猀攀琀 䀀猀琀爀㄀㴀䀀猀琀爀㄀⬀䀀猀ഀഀ
  set @i = @i + 1 
਍  攀渀搀ഀഀ
set @Str1=Ltrim(Rtrim(@Str1))  
਍刀攀琀甀爀渀⠀䀀匀琀爀㄀⤀ഀഀ
end
਍ഀഀ

਍ഀഀ

਍ഀഀ

਍ഀഀ

਍ഀഀ
GO
਍匀䔀吀 儀唀伀吀䔀䐀开䤀䐀䔀一吀䤀䘀䤀䔀刀 伀䘀䘀 ഀഀ
GO
਍匀䔀吀 䄀一匀䤀开一唀䰀䰀匀 伀一 ഀഀ
GO
਍ഀഀ
