Delete space

xiaoxiao2021-03-30  213

Create function f_trimstr (@str varchar (100))

Returns varchar (100)

AS

Begin

Declare @i intDeclare @ s1 varchar (50) Declare @Result varchar (100) Declare @LEN INT

SELECT @Result = '' SELECT @Str = Ltrim (RTRIM (@str)) SELECT @LEN = LEN (@str) SELECT @i = 1

While @i <= @ lenbegin select @ S1 = Substring (@ Str, @ i, 1) IF (@ S1 <> ') begin select @Result = @Result @ S1 end select @i = @i 1nd

Return @Result

end

Replace ((@ Str, ',' ') is OK

转载请注明原文地址:https://www.9cbs.com/read-130546.html

New Post(0)