Forum Discussion

Damone's avatar
Damone
New Contributor
4 years ago
Solved

How to Create a SQL Server Connected Lookup

I need to mimic Informatica’s simple connected lookup process. I want to look for a record on a target table and if it exists, update it, otherwise insert it. I have tried to use the Lookup Snap, b...
  • jcornelius's avatar
    4 years ago

    @Damone
    do it all in SQL
    ie
    IF EXIST(Select id from table_x where id=@id)
    BEGIN
    UPDATE table_x set col1=@col1 where id=@id
    END
    ELSE
    BEGIN
    INSERT INTO into table_x (id,col1) values(@id,@col1)
    END