Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ckrim
Starting Member
2 Posts |
Posted - 2014-10-02 : 13:54:51
|
Hi all I'm trying to create SQL query But I can't convert multiple rows (collections) in one row I got: Name Collection Name ps1 serverDP ps1 Adobe ps2 CRT ps2 Note I need: Name Collection Name ps1 serverDP ,Adobe ps2 CRT,Note Im using following query ....but it doesn't work .Need help!!! select v_FullCollectionMembership.Name as Name, CollName = stuff((SELECT '; ' + v_Collection.Name from v_Collection where v_Collection.CollectionID = v_FullCollectionMembership.CollectionID FOR XML PATH('') ), 1, 1,'') FROM v_FullCollectionMembership |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-10-02 : 14:29:25
|
What do you get from your query (error message, results) and what do you actually want to see, given a set of sample data? |
|
|
ckrim
Starting Member
2 Posts |
Posted - 2014-10-02 : 17:18:31
|
I get following results: ps1 |serverDP ps1 |Adobe ps2 |CRT ps2 |Note but I needps1 |serverDP ,Adobeps2 |CRT,Note |
|
|
|
|
|