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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 contatinating each row from field into one row

Author  Topic 

cidr
Posting Yak Master

207 Posts

Posted - 2009-12-01 : 05:05:42
Hi there,

I know there's a way to do this but I can't for the life of me remember.

The database I'm working on takes calls from clients. Each call is logged and can have muliple notes from a different table:

C.Call N.Note
1 This is Note one
1 This is Note Two
2 This is note 1
2 This is note 2 ....etc

I want to find a way to concat each note row together for each call so the rows don't repeat, like this:

C.Call N.Note
1 This is Note one , This is Note Two
2 This is note 1, This is note 2

Does anyone know how I can achieve this?

Many thanks for any help

:)

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-01 : 07:42:38
Refer this
http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/rowset-string-concatenation-which-method-is-best.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -