Subset Replication

  • I am designing a mobile client/server app.  This app has a central database, which contains a large amount of information.  Each client needs the ability to operate in a disconnected state, so each client will have a subset of the main database that applies only to that client.

    I am using SQL Server for the main database and SQL CE for the mobile database.  SSCE has a synchronization facility (replication) that we are planning to use to keep the data on both devices in sync.

    The question is:  given that we only want to sync a subset of the total database to any given mobile, how do you direct SQL to filter and sync only that subset of data?  Also, can filtering be controlled on a column basis, row basis, or both?  Finally, how do you specify what qualifies as a "changed" record?  Can you, for instance, tell the replicator to only look at certain fields to make this determination?

    Thank you for your help!

  • Firstly, you need to implement the MERGE Replication Model!

    Secondly, when you are createing the Publication, you will be given a chance to set filters! If you setup Merge Replication on a Development/Tets SQL Server, you will see what I'm talking about!


    Kindest Regards,

  • Thank you!

    I set up a merge replication publication in ss, and sure enough, there are the row and column filters.  Now for the fun part:  we need to set a row filter for a given mobile m based on m's location l.  How does ss know the location (which is just data entered by the mobile user) of the mobile in order to apply its filter?

    Obviously, m must tell the server its location.  Some choices would be to send the location via a web method or to save the location info in a table that we can somehow guarantee will be replicated first and whose value the server can access for its filtering task.  Are there other solutions that are better than these?  What is easiest and most robust for this problem?

    Any ideas?

  • You should check dynamics filter in merge replication. You can use functions likes @@SERVERNAME in the filter to apply changes.

    Check in BOL for dynamic filters

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply