Sync Framework: Can I synchronise Stored Procedure - sql-server

Does the sync framework allow me to synchronise (download only) the Store Procedures on a sql server 2008 server with the Stored procedures on the SQL Server 2008 client?
i.e. overwrite the SP on the client when the server SP's have been modified or new ones created?

No you cant do that, The Sync Framework is designed to sync data from server to a users pc and back again. While it can synchronize between servers, you are better off using SQL2008 replication engine, or a 3rd party API, such as Redgates SQLcompare, which you can operate programatically.

Microsoft Sync Framework is used to synchronize data not the database schema or the periphery. Generally speaking, this is an application update issue.

Related

Migrating to Azure Sql Database with external dependencies in another database

The question: Is it possible to point a view in database A running on Azure SQL Database service to tables/views on a SQL server running in a VM? I've tried external tables but come up short.
Scenario:
Two applications that is exchanging data, from two different vendors.
We've got three databases in total. One for each application and an integration database with views that both applications use either directly or through views.
The issue now is that we want to migrate to Azure and would prefer to use the Azure SQL Database service as much as possible, but one of the applications is not ready for it and therefor it's database has to be hosted on either a managed instance or in a VM.
The issue now is that there's view's in database A (running on Azure SQL Database service) that points to views and tables in the integration database, which again references tables in database B (running on SQL Server on the VM).
The short answer is "no". You can use external tables to query other SQL Azure databases, but there is no exact analogue for linked servers in Azure SQL Database. You can use SQL Azure Managed Instance (which supports SQL-SQL linked servers but not arbitrary linked servers).
There is a workaround, however. You can run SQL Server in an Azure VM and have it point to SQL Azure as a target as well as the other sources you want to connect. Then you can push data to/from Azure SQL DB using the SQL Server in a VM. You don't have the same management overhead in this approach since you don't really need to host data in the SQL Server if you don't want to do so. Note that this will be slower than doing direct connections to SQL Azure, but you can try to do this for a period of time if it would help you during a migration.

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.

Sync framework 2.1 with SQL Server 2008 and SQL Server CE doesn't sync inserts and dowload all updates

I'm using the Sync framework 2.1 with SQL Server 2008 and SQL Server CE with several clients.
I provisioned the client db and synced, then deployed that file with every client application.
Now sync doesn't seem to work correctly on all but one client. Did I need to provision the db for each client independently instead of using a copy?
This question does suggest so, please advise SyncFramework 2.1 updates & deletes do not seem to apply properly
in Sync Fx, each replica has a unique id to differentiate it from the other replicas. by copying a database, you'll end up with several replicas having the same id.
so what your doing will not work. if you want use a provisioned SQL CE database to initialize other clients, generate a snapshot and deploy the snapshot.
see: How To: Provision for Synchronization Using Snapshot Initialization

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).

Resources