标签:
CREATE PROCEDURE [dbo].[ReplaceSameStr]
@str varchar(8000)
AS
declare @ret varchar(8000),
@return varchar(8000)
select
@str = @str
select @str = @str+‘,‘
while charindex(‘,‘,@str) > 0
begin
select @ret = substring(@str,1,charindex(‘,‘,@str)-1)
select @return = isnull(@return+‘,‘,‘‘)+@ret
select @str = replace(@str,@ret+‘,‘,‘‘) end
select @return as newstr
标签:
原文地址:http://www.cnblogs.com/smilekiss/p/4195929.html