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)
 Export queries to individual Excel files

Author  Topic 

ChrisHorsley
Starting Member

7 Posts

Posted - 2004-09-09 : 09:39:13
I set up a DTS package using the export wizard to perform a multi
table query that I am then exporting to Excel. The query is being
sorted by the EmployeeID. . I would like to find a way to replace the
reference to a specific EmployeeID (inside of the query) with a global
variable and automatically export using the EmployeeID(global
variable) as the name of the Excel file.

I set up a global variable named gEID and am populating the global
variable with a query that extracts just the EmployeeIDs from the
employees table. Can someone please suggest a way to loop through
each EmployeeID as each query is run and Excel filed is exported?

Have seen several articles concerning looping but they usually applied
to importing data not exporting to individual files.
   

- Advertisement -