慕容3067478
declare @str varchar(100),@tmp varchar(101),@i int set @str= 'sddfd123fddfd56fddf78 ' set @tmp=@str+ 'a ' while patindex( '%[0-9]% ',@tmp)> 0 begin set @i=1 while 1=1 begin if isnumeric(substring(@tmp,patindex( '%[0-9]% ',@tmp)+@i,1))=0 break set @i=@i+1 end print substring(@tmp,patindex( '%[0-9]% ',@tmp),@i) set @tmp=stuff(@tmp,patindex( '%[0-9]% ',@tmp),@i, ' ') end