Upsert to SQL Succeeds, but no data exists?

  • 120Views
  • Last Post 20 December 2019
  • Topic Is Solved
0
votes
Ben West posted this 18 December 2019

Hello,

 

I created a table in SQL that mirrors my Zendesk table (organization). I set the ID column as primary key not null identity, and enabled identy insert. When I run an upsert operation, Skyvia succeeds without errors, but no data is moved. If I first do a table import, then switch to upsert, my updated records don't update either. The package number is 86591.

 

Am I doing something wrong?

Order By: Standard | Newest | Votes
0
votes
Dmitriy Muzurov posted this 18 December 2019

Hello Ben,

Thank you for submitting a ticket with us.

In Skyvia, UPSERT determines what action to perform in the following way: if a Null value is specified for the ID or primary key, UPSERT operation inserts the record, and if a non-null value is specified, UPSERT operation tries to update the record with the specified ID or primary key.

Please set up a lookup mapping for Id/PK field and don't forget to select "Set null when no match found" as specified at the step 8.

More details about UPSERT can be found here.

Should you have any questions, do not hesitate to contact us back.

0
votes
Ben West posted this 18 December 2019

Thank you. Should I be using an IDENTITY_INSERT on my SQL table so that the id/primary key field in Zendesk (my source) will be utilized for the same purpose in SQL (my destination)? Or will my SQL table need to have an extra primary key field separate from the one that Zendesk uses for the same purpose?

0
votes
Dmitriy Muzurov posted this 19 December 2019

Dear Ben,

Thank you for getting back to us.

It's not necessary to have the id/pk field of your SQL table store the same IDs. For successful INSERT, it just needs to be auto-generated.

A separate field in your SQL table that corresponds to the Id field from Zendesk can be created, if you would like to match by it rather than by email. Normally, email is a unique field used by default to match records.

Feel free to contact us back, in case of any issues.

0
votes
Ben West posted this 19 December 2019

thanks, that's what I ended up doing. All is well now.

0
votes
Dmitriy Muzurov posted this 20 December 2019

Dear Ben,

You are very welcome.

Should you have any questions, do not hesitate to contact us back.

Close