Pregunta Clean Foreign Key references after sync

  • jueves, 22 de marzo de 2012 12:54
     
     

    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?

Todas las respuestas

  • jueves, 22 de marzo de 2012 13:09
    Moderador
     
     

    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.