SSIS Insert/Update rows

Posted on 2009-04-26
Last Modified: 2013-11-10
I've managed to get an Insert working just fine, but couldn't manage to get an Update working in IS. Any ideas on what I need to consider for that?

I managed to get it all working using a Slowly Changing Dimension, but I've been reading that it's a bad object to be using and should be avoided.

Can someone help please?
Question by:PeterErhard
    LVL 39

    Expert Comment

    by:Pratima Pharande
    I have one suggetion here that I have used in my Poject
    Use Lookup to differntiate between insert and update
    In Lookupp add the cindition to check in database whether that record exists or not.
    If record not exits it will move on Red Line , add insert logic here
    If record exists it will move on green line , add updatelogic here

    LVL 39

    Expert Comment

    by:Pratima Pharande
    see image

    Author Comment

    Thanks for that.

    >>In Lookupp add the cindition to check in database whether that record exists or not.

    How do I do this? Could you provide a screen print and a bit of explanation please?
    LVL 39

    Accepted Solution

    Right click on Lookup control
    Look up Transformation Ediotor will open
    then in first tab Reference table select the table or view OR query
    then in Second table do the mapping in available columns and Look columns
    If that combination is present in table it will go for Green like ..Update
    Else REd-Insert

    see attached screens

    Author Comment

    ok thanks, will give it a try.

    Have you ever tried these custom components btw? as well?
    LVL 39

    Expert Comment

    by:Pratima Pharande
    I havn't tried it but when I get time I will definaltly like to try it.

    thanks for the Links
    LVL 22

    Expert Comment

    I haven't tried it before... I'll also take a look and post it in my blog!
    Good links..

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Viewers will learn how the fundamental information of how to create a table.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now