![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Input data Col1, col2 1, 'nebraska' 1, 'boston' 2, 'new york' 3, 'pekin' results desired: Col1 col2_concatenated 1 'nebraska,boston' 2 'new york' 3 'pekin' The problem i find is using sql server 6 (sql server 2000 with backward 6.0 compatibility actually). I cant do custom agregate functions (those are sql 2005 or later) I cant do "FOR XML PATH" (2005 or later also) |
#3
| |||
| |||
|
|
bradbury9 (ray.bradbu... (AT) gmail (DOT) com) writes: Input data Col1, col2 1, * * *'nebraska' 1, * * *'boston' 2, * * *'new york' 3, * * *'pekin' results desired: Col1 col2_concatenated 1 * * *'nebraska,boston' 2 * * *'new york' 3 * * *'pekin' The problem i find is using sql server 6 (sql server 2000 with backward 6.0 compatibility actually). I cant do custom agregate functions (those are sql 2005 or later) I cant do "FOR XML PATH" (2005 or later also) In SQL 2000, no matter the compatibility mode, creating comma-separated lists means lots of dirty work. I didn't check your solution in detail, but if you have it work, there is no idea to look for anything better. Well, it is better to do it the client, that's where presentation belongs. -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books... Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |
![]() |
| Thread Tools | |
| Display Modes | |
| |