How to Extract Multiple tables using SSIS

  • Hi,

    I want to Extract(Export) 4 tables from SQL SERVER 2008 R2 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.

    I wants to do through SSIS.

    Regards,

  • Four tables with different structures to one file?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • ranganathanmca (10/8/2012)


    Hi,

    I want to Extract(Export) 4 tables from SQL SERVER 2008 R2 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.

    I wants to do through SSIS.

    Regards,

    We cannot read your mind, so it would be really helpful if you provided us with the following:

    * schema of the source tables

    * schema of the flat file

    * sample input data and desired output

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I'll take a stab at answering this...

    Create a query of the data using SSMS that yields you all the data you need to extract.

    Create a Data Flow Task within SSIS

    Use OLE DB Source, creating a connection to your Database, for the Data Access Mode choose SQL COMMAND, paste the SQL that was pieced together in SSMS here, click on columns to ensure you have what you need.

    Drag a flat File Destination under the OLE DB Source, drag the green available output arrow to the flat file connection.

    Edit the flat file connection by right clicking edit, then click on the NEW button, to establish a new connection. Then Click on mappings to map the data between the two.

    You might need to create a test file first for setting up the new flat file connection, which can be accomplished real fast by using the import/export wizard out of SSMS. Open up SSMS right click on the database you need to extract data, select Tasks->Export Data and follow the simple wizard to get the data to a flat file.

    Once all is done in SSIS click green arrow button (Start Debugging) to execute...

    NOTE: if the number of records you want to extract is big, for setting the process up use the TOP command in the select statement of your SQL.

    Eat some pop corn and QA the flat file that was generated...

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply