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 |
|
cgatlan
Starting Member
3 Posts |
Posted - 2011-11-30 : 21:39:42
|
| Hi Guys,My first visit here, look like an impressive resource.I tried a search first but couldn't find the answer I need.The problem I have is trying to concatenate a field and group by another field. Let me give you an example..The table in the database looks like: (over 6000 entries)Server | Service-------------------sev001 | hostingsev001 | emailsev001 | infosev002 | infoSev002 | emailSev003 | printSev003 | FileSev003 | hostingSev003 | miscSev003 | scanSev004 | emailSev004 | miscThe output I want to archive is like this:Sev001 | hosting, email, infoSev002 | info, emailSev003 | print, file, hosting, misc, scanSev004 | email, miscetc..A colleague mentioned something about 'cursor' and 'stored procedures' but doesn't know how, and I don't have the first clue where to start with those. I'm fairly new to SQL and have only been writing some basic select queries.Can anyone help?Thanks, |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
cgatlan
Starting Member
3 Posts |
Posted - 2011-11-30 : 22:37:40
|
| Thanks for replying KH,Unfortunately, I'm still in the dark after viewing these links,They are referring to an XML path.. I don't have any 'external' files, the data I'm referring to is in a table in SQL Server 2008 R2. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-11-30 : 23:18:40
|
quote: Originally posted by cgatlan Thanks for replying KH,Unfortunately, I'm still in the dark after viewing these links,They are referring to an XML path.. I don't have any 'external' files, the data I'm referring to is in a table in SQL Server 2008 R2.
it does not need "external files". Follow the method & syntax used in the link and you should get the result KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|
|