SQL Azure We will migrate our database to SQL Azure in this post. There are many reasons why SQL Azure is a good idea.
Microsoft® SQL Azure™ (formerly SQL Server Data Services and later SQL Services) Database is a cloud-based relational database service built on Microsoft SQL Server® technologies
It provides a highly available, scalable, multi-tenant database service hosted by Microsoft in the cloud
SQL Azure Database helps to ease provisioning and deployment of multiple databases. Developers do not have to install, setup, patch or manage any software
High availability and fault tolerance is built-in and no physical administration is required. SQL Azure Database supports Transact-SQL (T-SQL). Customers can use existing knowledge in T-SQL development and a familiar relational data model for symmetry with existing on-premises databases
The portalThe SQL Azure Portal allows you to manage your database. Note that the server name of my particular database is bjzkzsxp9c.database.windows.net. Your database will have it’s own address.
The ‘master’ database is always there
stocksdb was created by click on ‘Create Database’ Before you can move your data from on-premise to SQL Azure, you will need to have a database ready to accept the data.
‘Create Database’ can be used
Options for a business user Notice that the business edition gives you several options in terms of the ‘size’ of the database you want.
Take note of the server name
Needed in connection stringIn the next blog post we will need to adjust our connection string so that our data comes from SQL Azure.
bjzkzswxp9c.database.windows.net is the name of our server. Yours will be different.
Migrating the SQL DatabaseSelect SQL Databaes below.
The ‘source’ of our data
localhostlocalhost is the local ‘on-premise’ version of our database. We are selecting the data that we want to copy to SQL Azure.
Choose the data that you want to migrate
The data is moving to the cloudBy selecting StocksDatabaseOnPremiseDb we are identifying the database that we wish to push to the cloud.
Narrowing down the data to migrate
You don’t need to migrate ALL the dataIn this case, we only have one table and a stored procedures that we wish to migrate. We are choosing ‘Script all database objects.’
Generating the SQL Script
Purpose of scriptThe SQL script that we generate will be used to migrate data. Clicking ‘Yes’ followed by ‘Next’ will take us to the next step. We will need to select a target database shortly.
Connecting to SQL Azure
Verify your Server NameAt this stage we wish to identify where we want to put our data. We have already identified the source. Now we need to identify the target. This is where you type in the server name that you got from the SQL Azure Portal.
Choosing the target database
StocksDBPreviously, when we were at the portal, we created a database called ‘stocksdb’It is a simple case of going to the AQL Azure portal and clicking ‘Create Database’ and then giving the database a name of ‘stocksdb’
Using SQL Server 2008 R2 Management Studio
Verifying our data migrated successfullyThe good news is that SQL Server Management Studio can be used with SQL Azure. This is a big deal and many of my audiences loved that this is true.
New Query Editor Window
Right click on dbo.StocksWe will just illustrate a ‘select’ statement.
We have completed this post.
Future Posts
MVC App still needs to be put in the cloudWe have succeeded in putting the data in the cloud, but our application (MVC Web App) still needs to be migrated. that is the subject of future posts.