• You can do it easily with the help of the DelimitedSplit8k. It's explained in here and you can find the code to create it in your system. http://www.sqlservercentral.com/articles/Tally+Table/72993/

    Once having it, the rest is easier.

    SELECT CATEGORYID,

    LTRIM( LEFT( s.Item, CHARINDEX( ':', s.Item + ':') - 1)) AS STARTRANGE,

    LTRIM( SUBSTRING( s.Item, CHARINDEX( ':', s.Item + ':') + 1, 200)) AS ENDRANGE

    FROM CATEGORIES c

    CROSS APPLY dbo.DelimitedSplit8K( c.CATEGORYLIST, ',') s

    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