How to auto sync local SQl Database with Microsoft Azure Sql database? - c#

I have a ADO.net application which generates some data in regular intervals that is stored in a local SQL server. I want that database to sync with Microsoft azure SQL database automatically. What would be the best process to make it happen?

You have two options. One of them is SQL Data Sync which will sync you local database with an Azure SQL Database and viceversa. It is a bi-directional replication that works best with SQL Server 2008 R2 (and later) on-premises databases. This service is in preview and you can get started with it by visiting this documentation.
Your second option is Snapshot and one-way replication that works with SQL Server 2012 and later. You can get started with it on this documentation.
Hope this helps.

Related

Sync SQL Server CE 4 database data with server everyday

I have an application on my local which is installed on different computers which is using SQL Server CE 4 (.sdf) database.
So what I want is, I need the data of that application to be merged on a single centralized database (Which can be on one of our online server which has SQL Server 2008 database) so that I can review it and can take some decisions.
Can anyone let me know which method will work in this situation.?

Sync Oracle Database with SQL Azure

I would want to sync up on-premises Oracle database with SQL Azure. Currently I have a DTS package setup for my on-premises applications (both Oracle and SQL Server being on-premise). If I move the SQL Server to Azure, how should this process be designed?
you have to options for moving to Azure:
Move to Azure SQL Database
Provision a SQL Server VM in Azure
the latter will have the same feature set as your regular on-premise SQL Server. The former is not fully-feature equivalent to SQL Server. Azure SQL Database is just the Database engine part, no SSIS, SSAS, Replication and even TSQL is not fully equivalent to SQL Server.
If you use the VM approach, its safe to assume you can still run your existing packages. However, you need to consider latency between Azure in the cloud and your on-premise Oracle database.
you may also build a custom solution to sync the databases or even use Sync Framework. see: Database Sync: Oracle and SQL Compact 2-Tier , just replace the SQL Compact with the SqlSyncProvider which works with the Azure SQL Database. You can change the sample to use an n-tier approach if you want to use WCF as well.
There are few differences between SQL Server and Azure SQL Database (SQL Azure renamed) so I suppose your code can work on Azure too with little effort. Azure SQL Databases do not have the same features and AFAIK the DTS package cannot run in the Azure environment. But I suppose you can think, if logic/traffic/latency permits, of running the DTS on premises interacting with the Azure SQL Database and Oracle.
You may find SQL Data Sync interesting:
SQL Data Sync is a web service that you use to keep your data synchronized across multiple servers in different locations

How Database Migration is possible in Windows Azure?

How to migrate database from sql azure to another DB server such as oracle for a single application hosted in windows azure for one client sql azure and for another client oracle as DB Server?
Your question is not very clear, but in most cases you can use the SQL Azure Migration Wizard when you want to migrate to and from the cloud.
The SQL Azure Migration Wizard (SQLAzureMW) gives you the options to
analyzes, generates scripts, and migrate data (via BCP) from:
SQL Server to SQL Azure
SQL Azure to SQL Server
SQL Azure to SQL Azure
As Sandrino mentions, question not clear, you could always use a BACPAC export to blob storage.
How to: Export a Data-tier Application (SQL Azure):
http://msdn.microsoft.com/en-us/library/windowsazure/hh335292.aspx
I prefer this option over the Migration Wizard, but have to say its a great tool!
*Note the SQL Database Migration Wizard is not supported, still an excellent tool and never failed me :)
http://msdn.microsoft.com/en-us/library/windowsazure/ee730904.aspx

Linq-to-SQL (dbml) with Local database cache (C#+VS2010)

I'm developing a WPF application, which connects MS SQL2008 database remotely.
The app communicates with the database by Linq-to-SQL. pretty handy.
However, because of the slow database server, I'm trying to use local database caching.
"VS2010 > Add Item > Local database cache" wizard could be a solution, but it uses DataSet and SQL Compact(*.sdf).
I found Linq-To-SQL cannot generate classes from the SQL COMPACT edition!
(when I drag tables, error pops up and says 'unsupported data provider')
So, is there any solution to use Linq-to-SQL with local database cache?
or is there any database sync method played with Linq-to-SQL?
If you still want to go the sql compact way, Lightspeed is a linq-to-sql provider that supports a variety of data-sources. it includes mssql compact.
http://www.mindscapehq.com/products/lightspeed
The free version is sufficient for most projects, with an 8 model/class limit.
Ive used it as a linq provider for MySql and Sql Compact before and it's been great.
You can see everything it supports and how it compares to other existing systems like it here:
http://www.mindscapehq.com/products/lightspeed/comparing-lightspeed
the Local Database Cache Wizard only supports SQL Ce on the client side. if you have SQL Express/SQL Server on the client side, you can use Sync Framework still.
see following samples/tutorials using Sync Framework:
Synchronizing SQL Server and SQL Express
Database Sync:SQL Server and SQL Express 2-Tier
nevermind if it mentions SQLExpress, the SQLSyncProvider referenced in the code should work against SQL Express,SQL Server, and SQL Azure

Synchronization MSSQL databases with selected data in .NET

We have database SQL server 2008 (db A). For better performance we will use next SQL server 2008 databases with the one workgroup (db B, C, ...). These databases will contain only necessary records and will can save some special records. These all databases are always full SQL server, not express.
So we need to synchronize data from db A to db B, C. And then we need synchronize some data (with special sql query - for example only completed orders, not all) from db B to db A, from db C to db A, etc.
The synchronization should be console application.
I found some examples used MS Sync Framwork:
SyncOrchestrator but I don't know how to select only some tables and some records.
SyncTable but here I don't know how correct set RemoteProvider and LocalProvider to database SQL server 2008.
Is there any way how to solve it? Or how can I correct use sync?
Sorry for my english, it's not my native language.
Many thanks.
check out the walkthroughs here: http://msdn.microsoft.com/en-us/library/ff928700(v=SQL.110).aspx
(the same walkthrough is in the documentation if you download Sync Framework 2.1)
that should get you up and running with defining a scope for your selected tables with filtering applied and specifying both local and remote providers as well. While the walkthrough says synchronizing between Sql Server and Sql Express, you can use the same for Sql Server to Sql Server synchronization as Sql Express, Sql Server and Sql Azure uses the same SqlSyncProvider.
I would use SQL Server Replication http://msdn.microsoft.com/en-us/library/ms151198.aspx

Categories

Resources