How can we help you today? How can we help you today?

Suggestion: Default values in the synchronization script

I have this set of databases that I must keep in "sync".

Each table has a DateTime column with the time of the last modification. These columns are excluded from the comparison but must be set in the synchronization. It would be nice to be able to set a default "value" (fixed or a function call) for the synchronization script.
paulo_morgado
0

Comments

3 comments

  • richardjm
    Yes we've come across this request before. I'll put your request on that list so we know you're after it.

    You could do something similar by adding a trigger to your table so that when a row was inserted it could add the appropriate value to the table at that point.
    richardjm
    0
  • paulo_morgado
    And I have suggested it before. :D

    I have thought of the trigger. In the present example it would be easy to have a trigger to set the the DateTime value to getutcdate(). But, what if I have another DateTime column "EfectiveFrom" that is a static value just form that synchronization operation?
    paulo_morgado
    0
  • richardjm
    OK it's possible to do via a set-up and tear-down sql setting a temorary table with date in that can be used via a trigger :). But yes I see your point, it's in the list (issue 476 if you're interested) so it will get considered for a future revision.

    Thinking more you could use indexed views on your data that replaced the column with a fixed value on one side and an insert trigger to go past the view on the other side, although now it's just getting nasty :D
    richardjm
    0

Add comment

Please sign in to leave a comment.