Function Setstring(cString:string):string; {提取数字} VAr i:integer; str:string; begin str:=''; For i:=1 to length(cString) do begin if Pos(cString[i],'0123456789.')<=0 then break else Ca…
CREATE FUNCTION [dbo].[StringExtractNumber(FirstOrLast)](@address nvarchar(max),@firstOrLast INT) returns INT as BEGIN DECLARE @returnInt VARCHAR(20) IF @firstOrLast=1 SET @returnInt= REVERSE(SUBSTRING( STUFF(reverse(@address),1,PATINDEX('%[0-9]%',re…