10-26-2021 10:57 AM
Hello,
I’m a new user to Snaplogic, so go easy. 🙂 My question is on using the “SQL Server – Merge” snap:
I’ve created a pipeline to import from a sftp csv-formatted source to merge (update or insert) into a table on an SQL server database.
It’s partially working! When I run the pipeline it successfully goes through the sftp->CSV parser->Mapper->SQL Server – Merge snaps to insert the csv-mapped records into the MS-SQL target db table with no problem.
But when running a second time I get a “Violation of PRIMARY KEY constrain” error, so new records can be inserted, but not updated.
My questions are:
How is the Identity Column setting used? I though it might be a setting for the primary unique key, but that does not seem to be the case.
With other pipelines I was able to setup a route-error-data view to capture errors into a file. When I attempt that with the SQL Server Merge snap I get an ‘Error branch will overlap with existing Snaps” error. I’ve attempted to rearrange the pipeline snaps but to no avail, I still cannot setup the error route view.
I’ve also reviewed and read the snap documentation at:
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439070/SQL+Server+-+Merge
I see that there’s a “ELT Merge Into” snap, but I do not have access to that snap from the designer tool.
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1123745847/ELT+Merge+Into
Should I be using that snap instead?
Thanks for any insights or guidance!
11-08-2021 07:51 AM
ID = $['xxxx']
) will be evaluated as string - ignoring the reference to the input document.11-08-2021 01:03 PM
Much thanks for your feedback. I’m still testing but it’s now working as expected as far as I can see.