Jeff is right. Based on what you given, i can only come up with this. It may not be what you actually want. Do post back and explain more in detail.drop table #olddrop table #new-- create table for tesitngcreate table #old ( col1 int)create table #new( col1 int, col2 int, col3 int, col4 int, col5 int, col6 int)-- insert data into old tableinsert into #oldselect 1 union allselect 2 union allselect 3 union allselect 4 union allselect 5 union allselect 6 union allselect 7 union allselect 1 union allselect 2 union allselect 3 union allselect 4 union allselect 5 union allselect 6 union allselect 7 union allselect 1 union allselect 2 union allselect 3 -- Old tableselect * from #old-- create an identity column for grouping & orderingalter table #old add row int identity(0,1)go-- Insert into new tableinsert into #new (col1, col2, col3, col4, col5, col6)select --r = row / 6, col1 = max(case when row % 6 = 0 then col1 end), col2 = max(case when row % 6 = 1 then col1 end), col3 = max(case when row % 6 = 2 then col1 end), col4 = max(case when row % 6 = 3 then col1 end), col5 = max(case when row % 6 = 4 then col1 end), col6 = max(case when row % 6 = 5 then col1 end)from #oldgroup by row / 6--order by r-- New Tableselect * from #new
KH