Do you mean you want assistance in generating the TSQL rather than having to type out the whole query? [SQL Prompt] from Red Gate has a column picker..... ![alt text] ---- Alternatively if you want to dynamically generate the sql, then try something along these lines ;with tally as ( select top 10000 ROW_NUMBER() over(order by sv1.number) N from master.dbo.spt_values sv1, master.dbo.spt_values sv2 ) , dates as ( select convert(varchar, cast('1 jan 2005' as datetime) + N, 103) as coldate from tally where cast('1 jan 2005' as datetime) + N between '1 jan 2005' and '1 jan 2007' ) select 'select ' + stuff((select '],['+coldate from dates for xml path('')),1,2,'') + '] from yourtable' Adjusting the date format to suit your column names :
http://www.red-gate.com/products/sql-development/sql-prompt/ : /upfiles/sqlpromptcolumnpicker.PNG
Ooops! Thats a lot of columns, are you using sparse columns? If you really need that many columns in your result, then Kevs recommendation is your best solution, but I would try to return as few columns as possible. Instead of having on query that returns everything, I would create more queries with fewer columns. To me it does sounds like you have a very denormalized database.