Destination data checking

  • Hi,

    Destination (OLE DB) has two table with existing data. (table1 : Person with Bonus and Table2: Person without bonus)

    The requirement is i want to insert the data from Excel source to these above table (OLE DB) Destination,

    Before inserting i want to check if the data (Specifically person Id) which i'm gonna insert is already exists or not,

    If Exists (Person), then i should not insert the duplicate data

    If Exists (personId)but there is some updation , then i should update the particular record.

    Please help on this. how to perform the above funtionalilty.

    Below is the data flow my package

    Excel Source (3 files) to UNION all task(To union all the 3 files data) to Sort Task(To sort the data ascendingly) to Aggregate ( Sum the metric values using group by person Id)

    To Conditional Split( Perons Id with Bonus and Person Id without Bonus) to Ole db Destination.

  • You can use a Lookup component to check if the record exists in the destination or not.

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

  • Thanks for the reply.

    The table has the row with person Id 204

    The PersonId 204 row is updated with bonus to without bonus(Say 10 to 15)..

    I want to update the particular row but the person id is already present in the destination.

    If i use lookup task then it will not update the particular row.

    Let no know if there any task for ths plz

  • With the Lookup task you will check if the person with ID 204 is already in the destination or not.

    If it is, you retrieve the bonus column (call it bonus_dest). Then you compare it with the bonus column of the source in a conditional split. If the values are the same, you don't need to do an update. If they are different, you need to do the update with an OLE DB Command.

    Be aware that the OLE DB Command executes a SQL statement for every row, so it is really slow for large datasets.

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

  • Hi guys,

    I have many excel files in the folder. I want to insert the data of all these files into tables with the excel files name.

    I create a package with Foreach loop container with data flow tsk into it with varibles defininf the files name.

    Variables:

    Name : FileName

    Scope : Package

    Datatype : String.

    Value : E:\Farooq\SSIS data Sources ( In this folder there are multiple excel files)

    I added derived column task to the flow and in the derived column, i used this varible but i'm not getting proper result and it is throwing error.

    Added to this, I configured the excel expression properties as

    Excel File Path : @User::FileName

    I'm not getting the desired result.

    Please help me on this.

  • What is the error?

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

  • It is not taking the second file.. And it is not inserting the file name too.

  • I mean the actual error description. The one that shows in the output tab in BIDS.

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

Viewing 8 posts - 1 through 7 (of 7 total)

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