Quantcast
Channel: MirrorSync by 360Works Latest Topics
Viewing all articles
Browse latest Browse all 492

Primary key issue in HUB using SQL Data

$
0
0

I have a situation that is causing me some issues. In my MirrorSync configuration I am able to download data from the HUD, make changes in the spoke DB and then sync back up and the changes are properly reflected in the HUB (Microsoft SQL) database.

However, I tried to add a new record on the spoke DB and when I did a sync operation, the error on the HUB indicated that the primary key field could not be null.

We manage the primary keys in our SQL database ourselves, so the next number for each table is stored and updated within the DB. MirrorSync must be expecting that our HUB table is using an Identify column to set the primary key. There is no way that I see of specifying the primary key value in the HUB database. In other words, if I could match up a value in the spoke DB with the primary key and then insert it, I could use an insert trigger on the HUB database to catch this and then assign it a new number in sequence. For example, I could setup a new field in the table called "Temp PK" and set it to some magic number like "999916". Then, I can trap for this on an insert trigger in SQL and assign it the correct way. The only issue that I see with this is that

1. I'm not sure how MirrorSync will be able to match up this new HUB PK with the Spoke PK, and

2. I'm not sure if there would be any conflict issues with multiple users syncing at the same time

 

Any advice on how to work around this would be helpful.


Viewing all articles
Browse latest Browse all 492