• The Pattern Splitter made by Chris Morris is able to help you in this situation. You can read about it in this article: http://www.sqlservercentral.com/articles/String+Manipulation/94365/

    And you'll end up with something like this:

    SELECT Code, MIN( Item) minvalue, MAX( Item) maxvalue

    FROM #temp t

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

    WHERE Matched = 1

    GROUP BY Code

    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