How to compare tables dynamically

  • Hi Friends,

    I am new to SSIS. I have a task ...

    For Examples I have two test db...two db's having emp and dept table with same structure. I need to compare this two tables dynamically by using ssis package and need to find out the difference in data. For this task i have used For Eachloop container. what i did is

    i have created another one test table with tow tables name in source. I passed this test table result in variable using record set. Inside the ForEach loop container, I have added DFT for comparision...while executing I am getting the error like

    [OLE DB Source [1]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.

    An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "The request for procedure 'emp' failed because 'emp' is a table object.".

    please any one help in this

    or

    suggest me for different approach..

  • vinodhkumargv (1/20/2014)


    please any one help in this

    or

    suggest me for different approach..

    I'll go for the second option. 😉

    It's not clear from your question whether you have the 'emp' and dept' tables twice (once per database) or the 'emp' table in one database and the 'dept' table in another, but essentially it makes no difference to what I'm about to say.

    If you want to compare data or check that data in one table exists\does not exist in another table (in the same database or a different database), you can use the Lookup component within a Data Flow Task. You will need to specify a column to match on, i.e. a column that is present in both tables and then you can route matching data down one path and non-matching data down a different path.

    You will also need to set up Connection Managers - they contain connection string info - for each database.

    Does that help?

    Regards

    Lempster

Viewing 2 posts - 1 through 1 (of 1 total)

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