Partial Replica Synchronization for MS SQL Server - sql-server

I need a means to create a SQL Server Express partial replica of a SQL Server 2014 server database and then synchronize the two, triggered by a C# command. Eventually, there could be as many as a hundred partial replicas on various clients. Anyone know how I can do this and where I should look to learn how to do it? Thanks!

SymmetricDS is a product that will synchronize SQL Server 2014 with SQL Server Express either in a partial sync scenario or full sync scenario. You configure which tables you need to synchronize. It will by default synch in near real time based on your configuration or you can schedule a variety of jobs to meet your needs. To support your C# use case you could look into the JMX and/or REST API's provided as well.
SymmetricDS Open Source
SymmetricDS Professional

Related

How to migrate data from SQL Server database to another over internet

I have two databases in SQL Server 2016 Express, one on the server and the other is local. I want to sync data from the local to the server database every day, one way.
I could not use replication or log shipping because SQL Server edition is Express.
I found the MS Sync framework could help but it is too old.
What is the latest technology for doing that?
Azure SQL Data Sync feature may be a very easy solution for your goal. Take a look at https://learn.microsoft.com/en-us/azure/sql-database/sql-database-sync-data
If you want the data synched not once per day but simultaneously, you could have a look at Microsoft Sync Framework 2.1. https://www.microsoft.com/de-ch/download/details.aspx?id=23217
I've used it over a custom WCF service, but I think you can use it directly with db connections.

SQL Service Broker - communication scenario - migration from SQL 2008 R2 to SQL 2014

Summary: Is there anything new in SQL Server 2014 (versus 2008 R2) that does not allow the following scenario? Can the same approach be transfered to the new server?
The application uses SQL Service Broker to collect data from satellite SQL Express machines (technology computers, now two, soon 4, and possibly more) to the central SQL Server with SQL Server Standard edition.
It is based on simplified security settings without the need to exchange certificates. I was asked to migrate the solution from SQL Server 2008 R2 to SQL Server 2014.
The situation was described in details at SQL Service Broker -- one central SQL and more satelite SQL... beginner wants to understand details and the solution was based on the Remus Rusanu's answer.
Yes. All SQL Server releases, from 2005 to 2014 inclusive, are compatible with each other at the Service Broker layer. In fact the 2008 instances are not even going to be able to figure out they are talking to 2014.
You should be able to migrate one machine at a time, w/o taking down everything. If the upgrades are don in-place (keeping the machine name the same and preserving the SSB endpoint settings) then you won't have to change anything after the upgrade, it should just keep working.
If you do side-by-side upgrade then you will have to port the SSB endpoint settings and certificates used from one instance to the other, along with moving the database.
Keep in mind that if you have a problem and you are forced to rollback to a backup then your entire, distributed, system state will not be consistent (basically conversations will no longer match the send sequence number and receive sequence numbers) and you may have to force some close conversations (manual END ... WITH CLEANUP on a case by case) or nuke the entire broker in the DB (ALTER DATABASE ... SET NEW_BROKER). Lets hope you won't have to do this. If is feasible then you could simply stop the entire system (eg. run ALTER ENDPOINT ... STATE = STOPPED on all 3 nodes to stop all SSB communication) and then do a backup and then do the upgrade, now being safe to rollback the upgrade and restore since everythign is 'frozen'.

Occasionally connected application (SQL Server data synchronization)

There is a central server that is running SQL Server 2008 R2 and WinForms clients, which use SQL Server CE to cache data. Data can be changed on both the server and client side. Each user can only edit his own data and view some of the data of other users. For example, a user can create a "Contract" and upload it to the server via synchronization, other users need to see this "Contract", except for customer's contact information, etc.
What a way to synchronize data is most suitable for this task?
Thanks in advance.
you can use Sync Framework to synchronize the local cache to a central server. You can either use the Local Database Cache Wizard in Visual Studio or code the sync yourself.
see Synchronizing SQL Server and SQL Server Compact
or Programming Common Client and Server Synchronization Tasks

Sync framework with SQL Server 2008 Change Tracking

Is there a way to synchronize two SQL Server 2008 databases(any edition) using Microsoft Sync Framework and SQL Server 2008 Change Tracking mechanism, instead of provisioning the databases with the required schema changes(triggers, sps, aux tables) to track changes?
Is there any code sample?
Yes, this is possible. Use the Sql Express sample sync provider (http://archive.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=1200).
It is not supported by Microsoft and it uses Sync Framework 2.0 techniques instead of the newer 2.1 techniques for collaborative sync.
Enable change tracking on the server, create the anchor and guid table on the client. Create sync adapters per table in the sync agent and you're off. You have to keep in mind that the sql express client provider uses the server provider under the covers, so you need to reverse it's thinking in some places (download becomes upload).

How to go about creating a SQL Server Agent clone / customization (NOT another SQL Server Express Agent question)

I'm managing a web app featuring countless ETL (Extract, Transform & Load) processes feeding a datawarehouse (using SSIS dtsx packages + *.sql files).
At the moment, everything is governed by several SQL Agent processes monitoring "scheduling queue" tables.
I'm trying to figure out a way to develop a scheduler or scheduling "framework" of some sort that needs to do a subset of what SQL Server Agent does (executing dtsx packages, executing SQL) but with a configuration UI based on ASP.NET, as users need to be able to create & modify schedules, manually launch processes and monitor custom logs.
Configuration info, activity, execution logs, schedules, jobs, job steps and everything else needed that I'm missing should be persisted to DB.
I'm guessing a Windows Service would be flexible but development costs might skyrocket.
I appreciate any sort of input, particularly some clues on SQL Server Agent's internal workflow. I DID try searching for info, but it being PROPRIETARY software, I found zilch.
(maybe I should specify I'm more than familiar with SQL Server and C# based .NET development, I just have no idea where to start from..)
The SQL server agent database is called 'msdb'. You can attach profiler to msdb and create some scheduled jobs to see how it works.
The gist of the answer is one should use SQL Server Service Broker, coupled with SQL Server Service Broker External Activator from the Feature Pack

Resources