Home Forums SQL Server 2008 SQL Server Newbies How to extract values from a column which has multiple delimiters? RE: How to extract values from a column which has multiple delimiters?

  • This is a different option using Pattern Splitting (using Lynn's sample data).

    select

    *

    from dbo.TestData td

    cross apply (select stuff((select ',' + ca.Item

    from dbo.PatternSplitCM(td.TestValue,'%[0-9]%') ca

    where ca.Matched = 1

    for xml path(''),TYPE).value('.','nvarchar(max)'),1,1,'')) ca3(IDs)

    The function and explanation can be found in here:

    http://www.sqlservercentral.com/articles/String+Manipulation/94365/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2