• If we're busting out splitters then another way would be using PatternSplitCM[/url].

    DECLARE @SomeTable TABLE (SomeString varchar(100));

    INSERT @SomeTable VALUES ('Recalc 2015659341589653'),('Recalc of 2015658926358915 revised'),

    ('Recalc to clm 15649687415315781536 error');

    SELECT SomeString, Item

    FROM @SomeTable

    CROSS APPLY dbo.PatternSplitCM(SomeString,'[0-9]')

    WHERE [matched] = 1

    --uncomment for extra protection against rogue numbers in the string:

    --AND ((item LIKE '1%' AND LEN(item) = 20) OR (item LIKE '2%' AND LEN(item)=16))

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001