Migrating Data Base from SQL Server 2008 R2 Enterprise to SQL Azure

No.of Views648
Bookmarked0 times
Downloads 
Votes0
By  Dhananjay Kumar   On  24 Jan 2011 08:01:18
Tag : Windows Azure , General
In this article walk through we will migrate an existing Database from SQL Server 2008 R2 to SQL Azure.
emailbookmark add commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

In this article walk through we will migrate an existing Database from SQL Server 2008 R2 to SQL Azure.

Creating Database

The first step is to create database. We are going to use School database.  Script of sample School Database copy from here

Generate Database Script for SQL Azure

Right click on School Database and select Tasks. From Tasks select Generate Script. 

Image Loading

From Pop up select Set Scripting option.

Image Loading

Give the file name by selecting Save to file option.
Now the main thing to be noticed here is we need to so some change in advanced setting. For that click on Advanced options.

Image Loading

After that click next and Finish. You can see a SQL file is created and we will be using this script to migrate our in house school database to SQL Azure.

Create School Database in SQL Azure

Login SQL Azure portal with your live credential
https://sql.azure.com/
Click on SQL Azure tab. You will get the project , you have created for yourself. 

Image Loading

Click on the project. In my case project name is debugmode.  After clicking on project, you will get listed the entire database created in your SQL Azure account. 

Image Loading

Here in my account there are two database already created.  They are master and student database.  Master database is default database created by SQL Azure for you.
Click on Create Database

 

Image Loading

Give the name of your database.  Select the edition as Web and specify the max size of database.

Image Loading

You can select other option also for the edition as business
After that click on Create you can see on Databases tab that Demo1 database has been created.

Image Loading

Run the Script in SQL Azure

Open SQL Server management studio

Image Loading

You will get Connect to server dialog box. Click cancel on that.

Image Loading

After cancelling the dialog box click on New Query  from left top

Image Loading

On clicking New Query, you will get the connect to server dialog box again.

Image Loading

Now here you need to provide, Server name of SQL Azure and Login credential of SQL Azure. 
To know what is database server name of SQL Azure portal, login to Windows Azure portal with your live credential and then click on SQL Azure tab

Image Loading

You will get the server name in form of
abc.database.windows.net
Where abc is name of your SQL Azure server.  We need to provide this server name at local sql server management studio. 

Image Loading

Make sure to select SQL Server Authentication and provide login user name and password of your SQL Azure database portal.
After that before clicking Connect click on Option

Image Loading

From Option select School database.

Image Loading

Run the Script

 Now once you successfully got connected to School Database in SQL Azure.  Copy the script and Run like below.

Image Loading

After successfully running of script , run the below command and all the tables name will get listed.

Image Loading

In this way you successfully migrated  database to SQL AZURE.

 
Sign Up to vote for this article
 
About Author
 
Dhananjay Kumar
Occupation-Software Engineer
Company-Infosys Technolgies,Pune
Member Type-Gold
Location-India
Joined date-20 Jul 2009
Home Page-http://dhananjaykumar.net/
Blog Page-http://dhananjaykumar.net/
Dhananjay Kumar is Microsoft MVP on connected system. He blogs at http://dhananjaykumar.net/ . You can follow him http://twitter.com/debugmode_/ and reach him at dhananjay.25july@gmail.com
 
 
Other popularSectionarticles
Comments
By:RRaveenDate Of Posted:2/3/2011 9:19:41 AM
Thank you
Hi Server Manage.. Thank you for your nice comments, ya we will look publish more good resources. tnx
By:server managementDate Of Posted:2/3/2011 12:03:03 AM
server management
Maintain up the nice job and I’m sure some other folks researching valued information will actually stop by and benefit from your site for resources.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top