Script to Merge two tables before loading to data warehouse

  • Hi..!

    I have two tables at the data staging level...I need to merge the columns from two tables and load it into data warehouse.How can I do that?Should I write some script or a stored procedure?But how does that get executed automatically as part of the ETL process?I am doing it using DTS and VB script...I am new to this...So please do help me...Any help on this wud be appreciated..

    Thankyou...

  • What is the meaning of "merge" ?

    Possible answeres are:

    For the Warehouse table, some of the columns have a source of one staging table and a different set of columns has a source of a different staging table.

    Some rows have a source of one staging table and other rows have a source of the other staging table.

    Other possibilities exists.

    Please post a very simple example which should include both

    1. Create table statements for all three tables.

    2. The primary key definitions of all three tables.

    Insert statements for the 2 staging tables would be appreciated.

    SQL = Scarcely Qualifies as a Language

  • In the DTS package you must add a connection to the database. Then add a "Execute SQL task".  In this task you can enter your Sql code to execute a stored procedure.  The stored procedure can do the update / insert into the new table.

    If you want more detail help you must give us more info as requested by Carl.

    5ilverFox
    Consulting DBA / Developer
    South Africa

  • Thankyou so much....Your answer helped me..it is working..Thankyou Carl...I could write the query but the problem was couldn't figure out how to run it automatically....Now it is running...

    ThankYou.

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

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