Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting to Excel

Status
Not open for further replies.

synapsevampire

Programmer
Mar 23, 2002
20,180
US
I need to export a table to Excel and dynamically create the file name and destination, any ideas or examples?

-k
 
Create a DTS package. First open up a connection with the Microsoft OLE DB Provider for SQL Server. Login to the SQL server with windows authentication or SQL Server authentication, which ever is appropriate. Then select the database you need to connect to.

Next make a connection to Microsoft Excel 97-2000. Specify an excel file name. Then select a Data Transformation Task. Once you have the task in place double click on it.

In the properties dialog, choose the source table, Create the destination table and then select the transformations.

Once that is done you can run the package.

Hope this helps.

Gary
 
Note: If Excel file already exist, selection "Replace records" does not work, you have to select "Delete file and create new"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top