This is a sample script. Copy and paste this query in SQL 2005. First it creates and inserts sample data in Test Table. Then it concatenates the value of col2 for each different value in col1. It is using CTE and recursion to get comma separated values. It avoids the use of cursor.
Find a String in a String in SQL Server
Learn how you can find data in a string and extract it, no matter where it's located.
2016-03-10
38,136 reads