DECLARE @MyTable TABLE (ID INT PRIMARY KEY, VAL VARCHAR(64))
INSERT INTO @MyTable VALUES (1, 'Cristian')
INSERT INTO @MyTable VALUES (2, 'Sorin')
INSERT INTO @MyTable VALUES (3, 'Narcis')
DECLARE @Lista VARCHAR(MAX)
SET @Lista = '';
SELECT @Lista=@Lista + VAL + ' ' FROM @MyTable
SELECT RTRIM(@Lista) AS Lista
GO
-- Output
Lista
Cristian Sorin Narcis
Cristian Andrei Lefter, SQL Server MVP
MCT, MCSA, MCDBA, MCAD, MCSD .NET,
MCTS, MCITP - Database Administrator SQL Server 2005
http://sqlserver.ro