is there any other fast way splist commaseprate values

  • hi,

    i have one function which return list of values from comma seprated value

    then i have one with cte which does it recusivly

    third is this one , is there any other way exist and which one will be fast.

    DECLARE @xml as xml,@str as varchar(100),@delimiter as varchar(10)

    SET @STR=' , A ,B,C, D,E , '

    SET @delimiter =','

    SET @xml = cast(('<X>'+replace(@str,@delimiter ,'</X><X>')+'</X>') as xml)

    SELECT ltrim(N.value('.', 'varchar(10)')) as value FROM @xml.nodes('X') as T(N)

    yours sinclery

  • http://www.sqlservercentral.com/articles/Tally+Table/72993/

    try the DelimittedSplit8K function (code is at end of article)

    edit typo

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply