none
Sync Framework 2.1 Foreign key constraints

    Question

  • I have seen many Questions on foreign key constraints problem and what I got is that By default, the following constraints are not copied to the client: FOREIGN KEY constraints, UNIQUE constraints, and DEFAULT constraints. 

    So, it appears I have to "manually" create the relationships, once the schema is created on the client.

    Once relationship has been created on client side, what if I make any changes in tables on server side, I have to recreate all relationships on client side again and again. Is not it'd be a headache. Is there anyway to write code or script to create foreign key constraints on client side that can be just copied. and if we make any changes on server side tables schema that could be done on client side by changing the script.So, it appears I have to "manually" create the relationships, once the schema is created on the client.


    • Edited by Naila Akbar Friday, August 16, 2013 6:54 AM
    Thursday, August 15, 2013 1:11 PM

Answers

  • I've got a solution that create client side table via synchronization and then add code to generate foreign key constraints. its easy way rather than to generate all tables ourselves and then add constraints to them. just copy lines for relations and that's all.

    • Marked as answer by Naila Akbar Friday, August 16, 2013 11:45 AM
    Friday, August 16, 2013 11:45 AM

All replies

  • Sync Framework doesnt automatically pick up schema changes made to the tables being synched. whether it's just an FK, column name/type/length change, you will have to re-provision (not unless you want to hack your way on the sync objects).

    if you want full schema fidelity, i suggest you create the database objects yourself (table, constraint, sp, triggers, etc...) and not let Sync itself create the tables for you.

    and btw, there is no Sync Framework 4.0

    Friday, August 16, 2013 2:32 AM
    Moderator
  • Sorry It was Sync Framework 2.1. I have edited it. thanks for correction
    Friday, August 16, 2013 6:55 AM
  • I've got a solution that create client side table via synchronization and then add code to generate foreign key constraints. its easy way rather than to generate all tables ourselves and then add constraints to them. just copy lines for relations and that's all.

    • Marked as answer by Naila Akbar Friday, August 16, 2013 11:45 AM
    Friday, August 16, 2013 11:45 AM