Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #919

Re: Custom agregation in Sql server 6

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: Custom agregation in Sql server 6
Date 2012-02-01 11:36 +0000
Organization Erland Sommarskog
Message-ID <Xns9FEC803BEDDD2Yazorman@127.0.0.1> (permalink)
References <31c22e19-fb3d-4707-8efd-4027736db61d@eb6g2000vbb.googlegroups.com>

Show all headers | View raw


bradbury9 (ray.bradbury9@gmail.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, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Custom agregation in Sql  server 6 bradbury9 <ray.bradbury9@gmail.com> - 2012-02-01 03:21 -0800
  Re: Custom agregation in Sql server 6 Erland Sommarskog <esquel@sommarskog.se> - 2012-02-01 11:36 +0000
    Re: Custom agregation in Sql server 6 bradbury9 <ray.bradbury9@gmail.com> - 2012-02-01 06:27 -0800

csiph-web