You could parse the comma-delimited string into a temp table with an identity field and sort by the identity field. The temp table would look like this:CREATE TABLE #Temp (Rownum int identity,ID int)
This article will tell you how to populate the temporary table using the comma-delimited string:[url]http://www.sqlteam.com/item.asp?ItemID=2652[/url]Your final SQL statement would look like this:SELECT * FROM X INNER JOIN #Temp ON X.ID=#Temp.ID ORDER BY #Temp.Rownum;