Previous Posts that you should review
![bullet bullet]()
|
Step 1
|
![bullet bullet]()
|
Step 2
|
![bullet bullet]()
|
Step 3
|
![bullet bullet]()
|
Step 4
|
|
|
Introduction
SQL Azure We will migrate our database to SQL Azure in this post. There are many reasons why SQL Azure is a good idea.
![bullet bullet]()
|
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 |
![bullet bullet]()
|
It provides a highly available, scalable, multi-tenant database service hosted by Microsoft in the cloud |
![bullet bullet]()
|
SQL Azure Database helps to ease provisioning and deployment of multiple databases. Developers do not have to install, setup, patch or manage any software |
![bullet bullet]()
|
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 |
|
|
Navigate to https://sql.azure.com
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. |
![snap0093 snap0093]()
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. |
|
![snap0094 snap0094]()
‘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. |
|
![snap0095 snap0095]()
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.
![bullet bullet]()
|
bjzkzswxp9c.database.windows.net is the name of our server. Yours will be different. |
|
|
![snap0096 snap0096]()
SQL Azure Migration Wizard
|
![snap0097 snap0097]()
Analyze and Migrate
Migrating the SQL DatabaseSelect SQL Databaes below. |
|
![snap0098 snap0098]()
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. |
|
![snap0099 snap0099]()
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. |
|
![snap0100 snap0100]()
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.’ |
|
![snap0101 snap0101]()
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. |
|
![snap0103 snap0103]()
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’ |
![snap0107 snap0107]()
![snap0108 snap0108]()
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. |
|
![snap0109 snap0109]()
New Query Editor Window
Right click on dbo.StocksWe will just illustrate a ‘select’ statement. |
|
![snap0112 snap0112]()
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. |