Skip to content

Updating record to fall in filter without reinitializing. Looking for soluitions. #539

Answered by Mimetis
matevzcesar asked this question in Q&A
Discussion options

You must be logged in to vote

Indeed, the best solution, in my opinion, is to have a ModifiedDate in your related tables, then add a trigger in your parent table, that will update all the related tables, to be sure they will be part of the next sync.

One trick: you can customize the trigger generation, using the OnTriggerCreating interceptor.

orchestrator.OnTriggerCreating(tca =>
{
    var cmdText = $"UPDATE TABLE" +
                    $"SET ModifiedDate = getdate() " +
                    $"WHERE ID = Inserted.ID;";

    tca.Command.CommandText += Environment.NewLine + cmdText;
 });

See https://dotmimsync.readthedocs.io/Interceptors.html#adding-a-new-column-in-a-tracking-table for another example

Let me know if it h…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@matevzcesar
Comment options

Answer selected by matevzcesar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants