Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 read in a file containing a query and saving output in Excel

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-08-23 : 09:45:31
Anoop writes "Hi,

I want to do read in a file containing a query and saving output in Excel file for reporting purposes.

I have used OSQL but unable to save properly into excel so that that can be used as an report. it's not understandabel format.

thanks
Anoop"

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2006-08-23 : 18:27:55
You can do an export-to-Excel task in DTS that should do it. Or you can manually create the spreadsheet using an ActiveX task. Actually this might be better because you don't know at design time what the column names will be.
I would create an ActiveX task that:
1. reads in the query text
2. executes the query and returns a recordset
3. use the Excel API to export the recordset to Excel.

HTH,

Tim
Go to Top of Page
   

- Advertisement -