Posts Tagged Common Table Expressions

CTE to concatenate column values in multiple rows into a single string

UPDATE:  While using PIVOT and CTEs to concatenate strings is cool, I’ve found a better way using FOR XML… see https://marcjellinek.wordpress.com/2011/08/20/concatenating-text-using-for-xml/ ORIGINAL ARTICLE: Using SQL Server, one thing I’ve always done is used PIVOT to concatenate strings.  The one thing about that solution is you have to impose a maximum number of rows that will […]

, , , ,

4 Comments