Below code is to retrieve column of values into one variable without using cursors. declare @col_list varchar(max) set @col_list = '' select @col_list = @col_list + col1 + ', ' from (select column1 as col1 from table1 ) d order by col1 select @col_list = left(@col_list, len(@col_list)-2)...