I came across this simple yet great way of translating a delimited string to XML using SQL 2005. http://www.sqlservercentral... /* Here is the string that we need to split */ DECLARE @str VARCHAR(100) SET @str = '0001,0002,0003,0004,0005' /* I am converting the string to an XML structure by inserting XML tags. */ DECLARE @x XML SET @x = '<i>' + REPLACE(@str, ',', '</i><i>') + '</i>' /* Now we can apply XQuery to return a resultset */ SELECT x.i.value('.', ......