ALTER PROCEDURE [dbo].[util]
@str VARCHAR(1000)
AS
BEGIN
DECLARE @strs VARCHAR (1000)
DECLARE @zhengzai INT --循环到哪个值
DECLARE @length INT --字符串长度
SET @length = LEN(@str)
SET @zhengzai = 1
WHILE(@zhengzai<=@length)
BEGIN
SET @strs = SUBSTRING(@str,@zhengzai,1)
SET @str = REPLACE(@str,@strs,'')
SET @str = @str+@strs
SET @zhengzai = @zhengzai+1
END
SELECT @str
END
@str VARCHAR(1000)
AS
BEGIN
DECLARE @strs VARCHAR (1000)
DECLARE @zhengzai INT --循环到哪个值
DECLARE @length INT --字符串长度
SET @length = LEN(@str)
SET @zhengzai = 1
WHILE(@zhengzai<=@length)
BEGIN
SET @strs = SUBSTRING(@str,@zhengzai,1)
SET @str = REPLACE(@str,@strs,'')
SET @str = @str+@strs
SET @zhengzai = @zhengzai+1
END
SELECT @str
END