[green]-- Declare a variable to concatinate all the rows into..--[/green]
Declare @x as varchar(800)
[green]-- Set a default value that is not null -- [/green]
Set @x=''
[green] -- in the select add the variable to itself and the value in the column and a comma --[/green]
select @x= @x + cast(OrderId as varchar(200))
+ ',' from Northwind.dbo.Orders
[green]-- Retrieve vaules and strip of the last comma--[/green]
select left(@x,len(@x)-1)