DECLARE @TestData TABLE
(
ID int IDENTITY(1,1) NOT NULL,
LinkID int NOT NULL,
Name varchar(10) NOT NULL
)
INSERT INTO @TestData(LinkID, Name)
SELECT 1, 'Foo' UNION ALL
SELECT 1, 'Bar' UNION ALL
SELECT 2, 'Xxx' UNION ALL
SELECT 2, 'Yyy' UNION ALL
SELECT 3, 'Aaa' UNION ALL
SELECT 4, 'Bbb'
I want to concatenate matching LinkID (in ID order) to form:
1, 'Foo,Bar'
2, 'Xxx,Yyy'
3, 'Aaa'
4, 'Bbb'
The data is in an @TableVar in an Sproc. I would prefer NOT to materialise it into a permanent table, but if I did I would know how to use a UDF to get this from it. 
SQL 2000 server (no SQL 2005 available for this job)
Thanks
Kristen