How to control table sync order
kkchan
Posts: 33
Hi,
I hit error when sync one of my table. It is caused by the Table PK used in another table. I am using trigger to control RI instead of foreign constraint.
Due to this, I need to control the table sync order as workaround. How could I do so?
Thank you
I hit error when sync one of my table. It is caused by the Table PK used in another table. I am using trigger to control RI instead of foreign constraint.
Due to this, I need to control the table sync order as workaround. How could I do so?
Thank you
Comments
I posted the script generated as below.
Master Table : Locations (LocationID - PK)
Child Table: Terminals (LocationID = FK)
As you can see, Terminal is "sync" before Locations.
Please advice. URGENT!
(In the case of DRI, the Disable foreign keys should be checked. There is also an option for dropping the primary keys, indexes and unique constraints which is often useful, especially when you are not using the Reseed identity columns option.).
Thank you for reply.
I was thinking to use your approach. However, some of my tables required DML trigger to update another table such as update stock.
Or, create another project for them as workaround? Any other ways?
Thank you
One possible solution would be to selectively disables the triggers yourself before making/calling the synchronisation process or you could replace these triggers with DRI.
The first solution should be easy to implement by doing a cut&paste or using the command line utility or the SQL-Toolkit. As for the second solution, it's up to you.