日期:2014-05-17 浏览次数:20818 次
CREATE FUNCTION fn_GetAttribute(@attribute NVARCHAR(MAX))
RETURNS NVARCHAR(MAX)
AS
BEGIN
DECLARE @output NVARCHAR(MAX) = ''
WHILE LEN(@attribute) > 3
BEGIN
SET @output = @output + SUBSTRING(@attribute,1,3) + ','
SET @attribute = SUBSTRING(@attribute,4,LEN(@attribute) - 3)
END
SET @output = @output + @attribute
RETURN @output
END