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, but I haven’t been able to make it work for me. Does someone have an example or a pattern that I can see?

  • @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

5 Replies

  • Hi,

    is the Single document output checked in the in-memory lookup snap settings?

    • kamalaker_pinna's avatar
      kamalaker_pinna
      New Contributor

      Hi Vineesha,

      Yes, it is set as Single Document output. However, the issue we encounter is in the Input JSON itself. As we are receiving multiple input for JSON, In memory lookup is taking time.

      Thanks,
      Kamal

      • vineesha's avatar
        vineesha
        Employee

        Did you try having the In-memory lookup snap in a child pipeline? As it provides Limited support in Ultra Pipelines when the Single document output field is selected.