Para seleccionar el texto entre `CATEGORY=` y la primer `,` que le sigue (o hasta el final del texto): <!-- language: lang-sql --> CASE WHEN CHARINDEX('CATEGORY=',m.DESCRIPTION) > 0 THEN SUBSTRING(m.DESCRIPTION, CHARINDEX('CATEGORY=',m.DESCRIPTION) + LEN('CATEGORY='), CHARINDEX(',',m.DESCRIPTION+',',CHARINDEX('CATEGORY=',m.DESCRIPTION)+1) - CHARINDEX('CATEGORY=',m.DESCRIPTION) - LEN('CATEGORY=') ) ELSE '' END Ejemplo: <!-- language: lang-none --> +----+-----------------------------------------------+-------------+ | | DESCRIPTION | Resultado | +----+-----------------------------------------------+-------------+ | 1 | ID=123444,CATEGORY=ABC,OTRO=#### | ABC | | 2 | ID=123444,CATEGORY=ABCDEF,OTRO=####,MAS=GHIJK | ABCDEF | | 3 | ID=123444,CATEGORY=A B C D E F,OTRO=#### | A B C D E F | | 4 | ID=123444,CATEGORY=,OTRO=#### | | | 5 | ID=123444,CATEGORY=ABC | ABC | | 6 | ID=123444,CATEGORY=ABCDEF | ABCDEF | | 7 | ID=123444,CATEGORY= | | | 8 | CATEGORY=ABC,OTRO=#### | ABC | | 9 | CATEGORY= | | | 10 | ID=123444,OTRO=#### | | | 11 | ABCDEF | | +----+-----------------------------------------------+-------------+ [<kbd>Ejemplo en rextester.com</kbd>][1] [1]: http://rextester.com/VVIKYI21002