Quote:
Originally Posted by bugs2bugs
Hello,
We're using SQL Server 2000 and Query Manager (not Visual Studio). When your query results are returned, the column names are displayed at the top, but this information is NOT available for cut/paste to Excel. One of the workarounds we thought of was to return the column names within the query itself, and thought there was perhaps an option or other feature of SQL Server that would allow us to put the column headings into Excel without having the type in the column names. Ideas/suggestions are appreciated.
Thanks
Heres one to add to your arsenal, adjust to suit you
- CREATE PROCEDURE dbo.usp_MakeSpreadsheet AS
-
exec sp_makewebtask @outputfile = 'c:\myspreadsheet.xls',
-
@query = 'Select * from dbo.MyTable',
-
@colheaders =1,
-
@FixedFont=0,@lastupdated=0,@resultstitle='Here are the results',
-
@dbname ='NameOfYourDatabase'
-
GO
-
Regards
Jim :)