标签:pre -- logs nvarchar 分割 style log span arch
DECLARE @str NVARCHAR(MAX); SET @str = ‘aa|bb|cc|dd‘; DECLARE @n NVARCHAR(100) SET @str += ‘|‘ WHILE LEN(@str) > 1 BEGIN SET @n = LEFT(@str, CHARINDEX(‘|‘, @str)) SET @str = RIGHT(@str, LEN(@str) - LEN(@n)) SET @n = REPLACE(@n, ‘|‘, ‘‘) SELECT @n END
----------------------------------------------------------------------------------------------------
aa
(1 行受影响)
----------------------------------------------------------------------------------------------------
bb
(1 行受影响)
----------------------------------------------------------------------------------------------------
cc
(1 行受影响)
----------------------------------------------------------------------------------------------------
dd
(1 行受影响)
标签:pre -- logs nvarchar 分割 style log span arch
原文地址:http://www.cnblogs.com/shenyixin/p/6505852.html