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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Querys in Local Pkg to Temp Table

Status
Not open for further replies.

ha1ls45

Programmer
Feb 20, 2005
105
US
Hi everyone,
I have 6 queries that all union together and I would like to split them all up and place them all within one big Local Package and have them all insert their data into a big temp table. Then, I would like this temp table to dump the data out to a network drive as an excel spreadsheet. Is this possible? I have created Local Packages before in the past, but I have just used the wizard. How would I go about doing this?

Thanks,
ha1ls45
 
Goto DTS pacage designer create Task Execute SQL.
I am not sure you can Insert values in a Temp table because as soon as the stament completed the temp table is gone. So create a table prior to that.
Enter all your Insert statements there

[tt]
Drop Table MyTable... If exist

Create Table MyTable

Insert into MyTable (select....
go
Insert into MyTable (select....
go
Insert into MyTable (select....
go
Insert into MyTable (select....
go
Insert into MyTable (select....
go
Insert into MyTable (select....
[/tt]

Now you can use a SQL source and destination.
Export MyTable to Excel in your network.
Suggestion: Try not use Excel, try to USE CSV or TXT. Excel alawys going to give you all types of issues and formatting.


Dr.Sql
Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top