Geeks With Blogs
Baskar B.V SQL - BI Consultant January 2010 Entries
Code to retrieve column of values into one variable as comma separate
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) ......

Posted On Tuesday, January 26, 2010 11:28 PM

Copyright © Baskar B.V | Powered by: GeeksWithBlogs.net