The CHARINDEX function will return the starting position of a substring within a string.
The SUBSTRING function will return a substring starting at a given position for a given length.
You can combine these, as for example, to return a substring of your first animal delimited by a "_":
Code:
SUBSTRING(animals, 1, CHARINDEX(animals, '_') -1)
TSQL is NOT the place you should be doing character/string manipulation, though ...
An even more important question is why you have composite data like this in the first place. This violates first normal form, and will cause you untold grief going forward. You'll find it very messy to query against such data, and it's ridiculously difficult to do things like accurately count how many rows have 'cats' in their animals column, etc.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com