Kmlakov's script, t-sql function to parse string data, posted on 1/19/2005, required the passing in text ends with the delimiter. But it is usually not the case. I rewrote the script (added one IF statement). The new script can treat the text with or without ending delimiter. The third parameter will be the number of delimiters. For example, the following two select statements have the same result:
SELECT * FROM [master].[dbo].[parsestring]('abcd,efg,hij,klm,no,pq,',',',6)
SELECT * FROM [master].[dbo].[parsestring]('abcd,efg,hij,klm,no,pq',',',5)