Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Is there a SQL funtion to concatenate a column from several rows into 1 string? Expand / Collapse
Author
Message
Posted Wednesday, October 23, 2013 5:41 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 1:39 PM
Points: 245, Visits: 735
Is there a SQL funtion to concatenate a column from several rows into 1 string? Do I need to build my own?

<><
Livin' down on the cube farm. Left, left, then a right.
Post #1507556
Posted Wednesday, October 23, 2013 5:50 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:21 PM
Points: 13,639, Visits: 10,533
Not a pre-defined function, but there are several methods to achieve your requirement.

Concatenating Row Values in Transact-SQL

The XML one is my favorite.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1507560
Posted Wednesday, October 23, 2013 6:06 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 1:39 PM
Points: 245, Visits: 735
Thanks. There are some interesting options.

<><
Livin' down on the cube farm. Left, left, then a right.
Post #1507564
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse