I am working with SQL Server, I have successfully converted a table\'s rows into comma-separated values, now I want to convert that string of comma-separated values back to
This question is a duplicate of a few others, but some of the accepted answers are still the inefficient WHILE loops or recursive CTEs. There are three ways to accomplish a split that won't kill performance:
Numbers / Tally Table: http://www.sqlservercentral.com/articles/Tally+Table/72993/ (free registration required)
XML: https://www.simple-talk.com/blogs/2012/01/05/using-xml-to-pass-lists-as-parameters-in-sql-server/
SQLCLR: there are numerous examples of this on many sites but your best (and easiest) bet is to either grab the one provided in the Numbers / Tally Table article noted above OR just install SQL# (SQLsharp) (I am the author of SQL# but String_Split and String_Split4k are in the Free version).