Suggestion: Default values in the synchronization script

paulo_morgadopaulo_morgado Posts: 97 Silver 2
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
Portugal
Web Site
Weblog
Twitter

Comments

  • 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.
    Richard Mitchell
    Project Manager
    Red Gate Software Ltd
  • 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
    Portugal
    Web Site
    Weblog
    Twitter
  • 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
    Richard Mitchell
    Project Manager
    Red Gate Software Ltd
Sign In or Register to comment.