标签:set dex nvarchar 分割 max arch har index varchar
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
标签:set dex nvarchar 分割 max arch har index varchar
原文地址:http://www.cnblogs.com/pilink/p/6688556.html