After working on a different question here on SO, I stumbled across recursive CTEs which would on the surface seem a fairly easy way to solve the \"Split a csv to table rows\" p
This one will work with empty strings
DECLARE @InputString VARCHAR(1000)
SELECT @InputString = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,,1'
SELECT SUBSTRING(',' + @InputString + ',', Number + 1,
CHARINDEX(',', ',' + @InputString + ',', Number + 1) - Number -1)AS VALUE
FROM master..spt_values
WHERE type = 'p'
AND Number <= LEN(',' + @InputString + ',') - 1
AND SUBSTRING(',' + @InputString + ',', Number, 1) = ','
GO
Also take a look at the comments here: Split string in SQL Server 2005+ CLR vs. T-SQL for some other ideas