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 2008 Forums
 SSIS and Import/Export (2008)
 How to Extract Multiple tables using SSIS

Author  Topic 

sagitariusmzi
Posting Yak Master

113 Posts

Posted - 2011-02-28 : 02:45:54
Hi,
I want to Extract(Export) 4 tables from SQL SERVER 2008 to a Flat File.
All the four tables are related to each other (through PK & FK relationships).

Tables are
1. Type
2. COA
4. VoucherMaster
5. VoucherDetail

How can i do that ? any help regarding this will be highly appreciated.


Regards,

latch
Yak Posting Veteran

62 Posts

Posted - 2011-02-28 : 14:52:47
Hi,

Plz check the following link:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=115061

Thanks,
latch
Go to Top of Page

sagitariusmzi
Posting Yak Master

113 Posts

Posted - 2011-03-01 : 07:02:50
I wants to do it using SSIS
Go to Top of Page

latch
Yak Posting Veteran

62 Posts

Posted - 2011-03-01 : 09:25:49
Hi,

In a SSIS package:
1.Add a Data Flow Task,
a.Take OLEDB source,make sure you select DATA Access mode as SQL
Command then specify the Query using Joins or UNION ALL.
b.Take flat file as destination.Map the columns respectively.

For refer how to specify the query using Join or Union All have a look at:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=115061

Thanks,
latch
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2011-03-01 : 09:33:22
Why don't you go to the database in question right click and select export data, this will allow you to select the four tables and their destination

Just a quicker solution than creating an actual ssis package.

If your wanting all the data together you can do the same as above poster has said using union or inner joins to link the tables together, and then use the export data option but use a query as the source instead of selecting the tables individually
Go to Top of Page
   

- Advertisement -