79

I have uploaded my application to Windows Azure Now I want to store My Local database to Windows Azure Database.

Please Suggest me how do I create table and backup the table there?

5 Answers 5

72

There are couple of ways to do that:

  1. The most reliable (that I usually use) is using the SQL Azure Migration Wizard
  2. Then you have the "Generate Scripts" option in your SSMS (SQL Server Management Studio 2008 R2 or later). The generate Scripts option does have a feature to make SQL Azure compliant script. It can also script data. But I suggest using method one if you want to migrate data, too. SQL Azure Migration Wizard uses BCP tool, which dumps the data into binary files, while SSMS just generates inline INSERT Statements
  3. SSIS (SQL Server Integration Services) - you can create a Data Transfer task, but I would use it very rare for small DBs.
  4. Export/Import data tier application (using DACPAC package) - this will migrate your schema and can migrate your data as well.

UPDATE 2017-10-24

Azure SQL Database now supports transactional replication from your on-premises SQL Server. You can configure your Azure SQL Database as subscriber and your SQL Server on-premise as publisher. You can read more about database migration options and strategies here: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-cloud-migrate

Update 2017-12-23

SQL Azure Migration Wizard has been replaced by Data Migration Assistant: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-cloud-migrate

4
  • I tried using SQL Server 2014 tools for the job but I was not successful. The SQL Azure Migration Wizard was the one that did the job properly.
    – nrod
    Sep 1, 2015 at 8:34
  • 1
    In a second migration a few days later, the SQL Azure Migration Wizard did not help. The solution ended up being: extracting a data-tier from the Local SQL Server (using Visual Studio SQL Server Object Explorer) and then publish that same file in Azure SQL Database (also using Visual Studio SQL Server Object Explorer) and selecting the checkbox Register as a Data-tier Application and check Allow incompatible platform in advanced options. Worked really fine!
    – nrod
    Nov 18, 2015 at 21:37
  • I am amazed how people come in 2017 and downvote answers given in 2011. But in that particular case I will still answer that the most reliable way to move SQL Database to Azure SQL DB is using the SQL Azure Migration Wizard. Unless you look for non-downtime migration.
    – astaykov
    Oct 16, 2017 at 9:37
  • 2
    SQL Azure Migration Wizard has been replaced by Data Migration Assistant: learn.microsoft.com/en-us/azure/sql-database/…
    – Jeroen
    Dec 21, 2017 at 11:30
25

If you already have a database on local machine then you can migrate it directly on Azure using SQL Management Studio. Follow these steps:

  1. Right click on the database name in SSMS

enter image description here

  1. Follow the wizard that appears then
3
  • do you need anything other than the IP when connecting to azure? do you need a port?
    – Danimal111
    Jan 23, 2017 at 22:09
  • No you just need the credentials of your SQL Azure account to connect to Azure in SSMS. In Azure Portal, you should have added your IP to access the DB using the Firewall settings in SQL Azure.
    – Vishal
    Jan 25, 2017 at 17:42
  • This worked well for me, but you have to be somewhat careful about what users are associated with the database. Any Windows-based users or services will cause the process to error out. Once you remove them it's all good to go again.
    – jocull
    Dec 12, 2017 at 17:27
5

There are a few ways in which to achieve this functionality.

  1. SQL Azure Import/Export. "DACPAC" & "BACPAC"
  2. Microsoft Codename "Data Transfer"
  3. SQL Azure Data Sync Windows Azure SQL Data Sync
  4. Migrating Databases using Import/Export Wizard in SSMS
  5. SQL Azure Migration Wizard (As Mentioned in other Answers)
3
  • Sorry if this is resurrecting an old topic, but some of these links are now outdated and no longer available. Aug 30, 2012 at 8:47
  • There was only one link that is unavailable, it has now been updated. Sep 1, 2012 at 2:34
  • 2
    thanks. Also, the Microsoft Codename "Data Transfer" lab phase is complete, I couldn't see anything from that page related to it, just assumed it's now outdated. Sep 4, 2012 at 13:42
1

I'm assuming you're referring to SQL Azure? If so, you'll probably want to use the SQL Azure Migration Wizard @ http://sqlazuremw.codeplex.com/

0

SQL Server 2012 Management Studio and SQL Azure Tools also now has this option I believe.

In SSMS if you right click on the Databases root, there is an option "Import Data-tier Application...", which allows you to restore a BACPAC (you can also right click on a database, and select "Export Data-tier Application..." to export an existing database to a BACPAC).

SQL Server Data Tools enables Visual Studio 2010 with a Data Compare option, which can also be used to move data between two database instances (which would be suited to smaller data patches).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.