sql - How to deal with column which save AMOUNT value with the replication -
we using sql server 2008 sp 2, , there replication between 6 sites
the problem is:
we save amount values in column (ex: 500$), maybe changed in 2 sites @ same time, if replication downwards @ time, have 2 different values in both sites, , if utilize recent updated or publisher winner wrong amount value
are there replication strategies merge 2 values?
there unusual question. if utilize transactional replication (see here) on transactional database, not happen.
the problem database not designed correctly. allowing "incremental" changes go fields, without storing increments (transactions). question bit ambiguous, because don't explain should happening. why isn't recent value sufficient?
you should storing database changes transactions:
starting value: $500 transaction 1: add together $100 transaction 2: subtract $200instead of absolute values:
starting value: $500 transaction 1: alter value $600 transaction 2: alter value $400in first case, can apply transaction in either order grab up. in sec case, end applying 1 of them.
summary values, such balance, should derived transactions, perhaps using triggers or stored procedures.
sql sql-server-2008
No comments:
Post a Comment