Strategy to sync 2 Microsoft SQL Server databases - sql

I've gotta admit that I'm a Microsoft .NET developer, and I'm not an expert in SQL Server.
I have developed a Windows app, with data stored in my local SQL Server (Express version). I recently purchase a shared hosting service, including a SQL Server. I thought about backing up my local data to remote server: about 5-6 tables from my local SQL Server to remote server, and 1-2 tables from remote to local
What's the best way to do this? DB size is limited to about 5-10MB. The structure of 2 DBs are different, synced tables have same structures. Is there an automatic script I can run from SQL Server Express to do this task every 15 minutes or so?

For initial publishing I’d just go with restoring a backup in the hosting environment. For further synchronization you can try some of the 3rd party tools such as ApexSQL Data Diff or SQL Data Compare or basically any other tool in this category…

Related

SQL server to Azure process workflow migration

We are supporting a legacy system for our organisation. In the current scenario, we receive a SQL Server backup (.bak files) from the application vendor on an FTP location. For every weekend on Sunday it is a Full backup and for every other day its the differential one.
On our side, we have a SQL server instance running which has custom stored procedures written and scheduled to check the location every morning and then restore the backups every day. These restored backups are then used by the organisation for internal reporting purposes. There are 100s of other stored procedures written for different reports in different DBs on the same instance.
Since SQL Server 2008 is now out of support and for cost-saving purposes of running on-premise system, my team has been given a task to look into migrating this whole system to Azure SQL database.
My question is what is the most effective way in which we can move this workflow to the cloud? I have an azure trial account set up for me to try but haven't been successful in restoring the .bak files on Azure SQL instance.
Thanks.
You essentially have two options for Azure, either perform a fairly linear Lift and Shift to SQL Server on an Azure VM or go with a more advanced Azure PaaS offering in Azure SQL Database Managed Instance. The specific deployment Azure SQL Database (Single Instance) will not support your current solution requires with regard to the .bak file support, and I have detailed that below. For further details between the difference between Azure SQL Database Single Instance versus Managed Instance, please see: Features comparison: Azure SQL Database and Azure SQL Managed Instance
The second option, is to leverage the Azure Enterprise Ready Analytics Architecture (AERAA) (link) of Azure (PaaS) Analytics services. With Azure SQL Database (PaaS) services, as opposed to on-premise SQL Server or SQL Server on an Azure VM, there is no Integration Runtime or Analysis Services as a bundled service component. These services are separate PaaS offerings and with the help of the linked AERAA blog, you can gain a better understanding of the Azure Analytics services.
The .bak versus .bacpac support dilemma:
Since the main requirement for your solution is support of .bak files, you need to understand where .bak and where .bacpac files are supported. The term Azure SQL Database applies to both a specific deployment option for an Azure SQL database (PaaS) service and as a general term for Azure SQL cloud databases. As for the specific deployment option, Azure SQL Database (Single Instance nor Elastic Pools) will support your scenario with .bak files. This deployment option will support export/import functionality via .bacpac file format. It will not support full/partial restore functionality. The backup/restore functionality although configurable, is only in scope for the specific database hosted by an Azure SQL (logical) Server instance. Basically, you can not restore an external file. You can import, which is always a full copy. So, for that reason, for an Azure PaaS database service you will need Azure SQL Database Managed Instance for .bak file support or deploy an SQL Server VM image to an Azure VM, and migrate your objects via Azure Database Migration Service.
Regards,
Mike

Which edition of sql server 2008,10,12,14 support replication and publication, as i need sync of data

Please help me regarding sync of data between two sql servers automatically using replication and publication.
Please help me which edition provide these features and how to configure these services to automatically sync data between local sql server and remote sql server.
Thanks
Replication has been part of SQL Server at least since the version 2005.
It's not a question of version number, but of type of edition (express, standard...)
If you need replication, you will need at least a standard version on the publisher server. Any version will work on the subscriber.
Note that if you just want to get a backup (for development purposes or a preprod server), you're probably better off writing a small script (in Powershell for instance) that generates a backup of the source server and downloads/uploads it to the target server every night or so.

SQL VM Missing in Azure SQL Databases

I have an operational SQL VM in Azure. How do I provision Azure to see it under SQL Databases and provide it as an option when creating something like Mobile Services?
That is not possible. The SQL Database feature is a service and, while it does run a highly compatible SQL Server environment, it is not the same as the SQL Server you would install on premises, or on a hosted virtual machine. There is not a way to "register" an existing SQL Server database, either in or outside of Azure, as a SQL Database instance.
If you want to have the Mobile Services system pointing to a SQL Server instance that is NOT a SQL Database I do not believe that is possible either. You can post a suggestion to the http://www.mygreatwindowsazureidea.com/forums/34192-general-feedback- site. The product group does monitor this and take it into account during product backlog sessions.

Export SQL database (all tables) from remote server

I'm current using a 3rd party product, which uses an SQL Server database. I've been asked to take a copy of the database for our own backup/security purposes, but I'm having trouble.
To access the database I'm currently logging into one of my companies servers using remote desktop, where SQL Server 2005 Express is installed. Using that instance of SQL Server I then connect to the 3rd party's SQL server.
when I execute Tasks -> Back Up..., it appears to work, but the files are stored locally on the remote SQL Databases server, which my IT teams tells me is expected.
I tried using Tasks -> Generate Scripts... but the option to "Script Data" isn't available, either because it's SQL Server 2005 Express, or because the database is remote (not sure which, but probably one of those).
I've tried other things that I can't recall at the moment, and I'm out of ideas.
Can anyone suggest something that will let me get a 'local' copy of the remote databases table structure AND data?
The Generate Scripts wizard is unavailable because you are using a very old version of Management Studio Express. The 2012 version will work just fine against 2005 instances, but there is no longer an Express edition anyway, because all of the SSMS features are now available without any license.
Download the latest versions here:
https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
I list downloads for the older versions at the bottom of this post:
https://blogs.sentryone.com/team-posts/latest-builds-management-studio/
Backups do generate locally. That is to be expected, as your team has already told you. You can generate it locally and then download it with a tool such as an FTP client. I highly recommend Redgate tools. See http://www.red-gate.com/products/dba/sql-backup/ It's a great tool and has some network backup options built in to ship your backups elsewhere. If it's a one-time thing, Redgate also has tools for that too, e.g. SQL Compare and SQL Data Compare.
The solution you pick really depends on how frequently you have to run and download backups locally and how big the DB is.

Restore a SQL Server database from single instance to cluster

I need to transfer a database from a SQL Server instance test server to a production environment that is clustered. But SQL Server doesn't allow you to use backup/restore to do it from single instance to cluster. I'm talking about a Microsoft CRM complex database here.
Your help is greatly appreciated.
Have a look at the Microsoft SQL Server Database Publishing Wizard:
SQL Server Database Publishing Wizard
enables the deployment of SQL Server
databases into a hosted environment on
either a SQL Server 2000 or 2005
server. It generates a single SQL
script file which can be used to
recreate a database (both schema and
data) in a shared hosting environment
where the only connectivity to a
server is through a web-based control
panel with a script execution window.
If supported by the hosting service
provider, the Database Publishing
Wizard can also directly upload
databases to servers located at the
shared hosting provider.
Optionally, SQL Server Database
Publishing Wizard can integrate
directly into Visual Studio 2005
and/or Visual Web Developer 2005
allowing easy publishing of databases
from within the development
environment.
You don't have to use the server-side piece; the client-side 'create a script' piece is generally enough.