Home > SQL Azure > SQL Azure data migration using Import/Export tool

SQL Azure data migration using Import/Export tool


In my previous blog post, I have shown you how to upload data to SQL Azure database using SSIS. In this post, I will show the data migration operation using Import-Export wizard.

Implementation

In this example, I am going to migrate data from a table ‘CountryRegion’ (Adventureworks2012) to  SQL Azure.

Table creation in SQL Azure: I am going to create the table definition in SQL Azure before data upload. This step is to ease the data migration process. Because, tables in the SQL Azure must have clustered index. So, creating table before data migration will be a best option.

Table creation Script:

CREATE TABLE [dbo].[CountryRegion]
(
    [CountryRegionCode] [nvarchar](3) NOT NULL,
    [Name] nVarchar(50) NOT NULL,
    [ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_CountryRegion_CountryRegionCode] PRIMARY KEY CLUSTERED 
    (
        [CountryRegionCode] ASC
    )
) 

GO

Step 1: Open Import and Export Wizard

pic1Step 2: Fill Data source information in this window.

pic2Step 3: Fill Destination information. We need to fill information for two categories in this window

  1.  Security
  • User ID
  • Password
  • Encrypt (Optional) – But it is best practice to set true.
  1. Source
  • Data Source (SQL Azure)
  • Initial Catalog (Database name)

pic3

Step 4: Choose table copy option in this step.

pic4Step 5: In this step, we have to map tables between  source and destination for data migration

pic5Step 6: Data type mapping wizard. Just click next. We don’t have any specific type conversion.

pic6

Step 7: Package execution wizard. We can save these steps in a package if you use SQL Server Standard, Enterprise, Developer or Evaluation.

pic7Step 7: This is wizard summary. You can validate all settings you have made and click finish if it is valid or you can go back to the previous steps to modify them.

pic8

Step 8: Close the wizard. We have migrated data successfully.

pic9This is an easiest way to migrate data to SQL Azure.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: