Clean Foreign Key references after sync RRS feed

  • Question

  • I don't know if this is the right place to ask this question, but here's the problem:

    I succesfully sync 2 databases, both have the same parent-child references: Parent: tblUser (with column FunctionID), Child: tblFunction

    So before sync:

    Database A:  
    UserX - functionID 1 (function with id 1 = "engineer")

    Database B:
    UserY - FunctionID 4 (function with id 4 = "engineer")

    And after sync (in both database A and B (as required)):

    UserX - functionID 1 (function with id 1 = "engineer")
    UserY - FunctionID 4 (function with id 4 = "engineer")

    After sync, function 1.equals(4).... I would like to 'clean' this up by removing functionid 4, and replacing the 4 functionID in tbUser.FunctionID by a 1

    Can this be done programmatically? Either in TSQL or by using the syncfx?

    Thursday, March 22, 2012 12:54 PM

All replies

  • syncfx definitely cannot do this for you. you'll have to do it programmatically manipulating the database (via SQL, EF, etc...)

    btw, if functionId is a PK, you'll break the sync by updating a PK value. note also that any change you make to the rows will be synched as well. if you delete functionid4, the delete will be recorded and will be picked up by sync.

    Thursday, March 22, 2012 1:09 PM