Here is the situation...
I have two databases.. Database1 and Database2....have same schema...
What ever i change( Update or delete or insert... what ever ) in Database1, Database2 should also get changed with same changes...
But when i change something in Database2... Database1 should not be changed...
Got itt.. its something like Official accounts database ( Database1 ) and Unofficial accounts database ( Database2 ).....
Database Mirroring is likely out for this application, because the mirror database will be down and not updatable while the primary database is up. I think you will need to look into either Transactional Replication or more likely Merge replication.
I'd maintain two copies of the data structure in the target database, under different schemas. One schema would be local, while the other schema would be replicated from the source database. Union together the tables in views for querying the combined data.
If it's not practically useful, then it's practically useless.
I've used one way replication - I just assumed that the published data was read only. I had no reason to want it otherwise so never looked at the issue. So how does it handle replicating updates from the published database if the equivalent row has been edited in the subscriber database? * There are a variety of different ways to handle this that would depend on the business rules.
*Actually don't answer that - it's sort of rhetorical
I believe the publisher simply sends the new value. If you ran something like this on the publisher;
set price = price * 1.1
Only the new prices would be sent to the subscriber. The subscribers would not be required to try to do all that tricky decimal math in figuring out the new price. After all, why should they? The publisher already knows what the new price is supposed to be.
So that would update the price column only in every row at the subscriber? All other columns in the row do not get replicated? And what if someone had changed the price at the subscriber - does that get overwritten?
That's why I would really want to know the replication rules inside out as it is not too unlikely that would contradict the business rules.
Don't go proving owt. I do fancy rereading BoL replication now though because (and again I didn't have this question in mind when I last worked with it so am a bit hazy) I thought the entire row was replicated, not just the changed column value.