locked
Why doesn't Sync Framework synchronize my databases' relationships? RRS feed

  • Question

  • Hi,

    I created a Local Database Cache item to sync between a SQL server and an SDF (via WCF service).

    I successfully generate the tables in the (new) SDF, but the relationships aren't copied as well. What could be the reason?

     

    Thanks,

    Assaf.

     

    Edit: I'm using Vs 2010, and Sync Fx 2.1.

    Sunday, September 19, 2010 2:05 PM

Answers

  • afaik, there;s none. as you have mentioned, you have to either do it programmatically or run a post-sync-initialization script to add the constraints.

    Monday, September 20, 2010 2:14 PM

All replies

  • afaik, by default Sync Fx does not copy Foreign Key, Unique and Default constraints.

    Monday, September 20, 2010 1:13 AM
  • Thanks June.

    I read up on the subject, and found out as much. I managed to find two solutions, neither of which I'm happy with: I can Either programmatically add the constraints, or apply an SQL script to alter the tables, after the synchronization - both options requiring me to hand write the code / SQL to do so.

     

    Is there anyway that I can automatically generate the constraints? 

    Thanks,

    Assaf.

    Monday, September 20, 2010 8:44 AM
  • afaik, there;s none. as you have mentioned, you have to either do it programmatically or run a post-sync-initialization script to add the constraints.

    Monday, September 20, 2010 2:14 PM
  • Grrr... This makes the framework almost not production-ready. At least it still is better than hand-writing the boilerplate code to handle this.
    Monday, September 20, 2010 2:18 PM
  • Hi JuneT,

    Is there any example on how to do this somewhere ?

    Best Regards,

    Bernard

    Sunday, September 26, 2010 2:56 PM