How To Upload SQL Database To Azure

Upload SQL Database To Azure

This Azure tutorial will discuss How To Upload SQL Database To Azure. We will also discuss importing Data Into Azure SQL Database.

How To Upload SQL Database To Azure

There are multiple ways to move or upload your database to Azure. Let’s discuss the ways to upload the SQL database to Azure.

Let’s discuss various options to import the local SQL server database to Azure.

Approach-1: Using Deployment Wizard of SQL Server Management Studio (SSMS)

  • Navigate to the Database in your SQL Server Management Studio.
  • Right-click on the Database name –> select Tasks option –> Click on Deploy Database to Microsoft Azure SQL Database.
How To Upload SQL Database To Azure
  • On the Deploy Database wizard, on the Introduction tab, click on the “Next” button, and then on the Deployment Settings tab, provide the Server connection, A new name for the Database, the Edition of Microsoft Azure SQL Database, the maximum size of the database, etc. and then click on the Next button.
  • Review the summary of the Deployment Settings. If all options are ok, then click on Finish.
  • Now, it will validate all the options. If all is well, it will create the BACPAC file and then use Azure SQL for database creation.
  • It will take a few minutes, and once the process is completed, you will find that the database has been created successfully in the Azure SQL Server.

Approach 2: Using the Generate Scripts option

You can use the Generate Scripts option from the SQL Server Management Studio (SSMS) to export a script from the SQL Server Management Studio. Then, executing the script to create the schema in your Microsoft Azure SQL DB would be best.

Using the Generate scripts option, let’s discuss the complete steps to migrate an existing SQL Server database to an Azure SQL Database.

  • Navigate to the Database from your SQL Server Management Studio that you want to export.
  • Right-click on the Database –> Click on the Tasks option and then select the Generate Scripts option.
How to Import Local SQL Server Database to Azure
  • Click on the objects to export tab from the left side. To select the database objects to the script option, you can select the script of the entire database and all database objects or select specific database objects based on your need and then click on the Next button.
  • Now, on the Set scripting options window, select the option to save the script, like save the script to file, clipboard, new query window, etc.
import the local SQL server database to Azure
  • You can also set the advanced scripting options.
  • You can click the Advanced button and set the Script for the database engine type property to SQL Database if you don’t want the stand-alone SQL Server instance. Click on the Next button.
  • Now, you can also set the Types of data to script option to Schema only, Data only, Schema, and data based on your requirement.
  • Finally, click on the Finish button. Now, it will generate the script on the local path you provided to save the file or the option you selected to save the script.
  • Now, You can run this script on your Azure SQL Database.

Approach-3: Using the SQL Server Migration Tool

If you don’t want to use the Deployment Wizard of SQL Server Management Studio (SSMS), you can also use the SQL Server Migration tool to migrate your local SQL server DB to Azure easily. Download the SQL Server Migration Tool now.

Once you have downloaded the tool successfully, you can follow the below steps to migrate the local SQL DB to Azure.

  1. The first step is to launch the migration tool and click the Open button.
  2. Now, choose the Quick Scan option.
  3. The next step is to select the SQL Server version of the database. You can choose the Auto-detect option if you are not sure about the version of the SQL Server version of the database.
  4. Now click on the NDF options tab and select the NDF file as you need to add the NDF file. The tool will also help you choose the NDF file automatically.
  5. Once the NDF file addition has been successfully done, you can preview the complete database. Now click on the Migrate button to import the database to Azure.
  6. The next step is to add the Azure database details, including the login credentials, and then click the Connect button. It will take a few seconds to connect.
  7. Now select the Destination Database name from the list of databases.
  8. The next step is to mark the database components you want to move to Azure SQL Database, which is on the left side of the tool.
  9. You can select “With schema” or “With schema & data.” based on your requirements.
  10. Finally, click on the Migrate button. It will take a few minutes and will successfully migrate the local SQL server DB to the Azure SQL server DB.

Import Data Into Azure SQL Database

Well, here we will discuss multiple available options that can be used to import data into the Azure SQL database. Below are a few of the critical options.

Method-1: Using the SQL Server Import and Export Wizard

Using the steps below, you can use the SQL Server Import and Export Wizard to import or export the data into the Azure SQL database.

  • Navigate to the SQL Server Management Studio and locate the Database.
  • Right-click on the Database and click the Tasks option –> Click on the import data option.
Import Data Into Azure SQL Database
  • Choose the Data Source on the SQL Server Import and Export Wizard.

Method 2Using the Flat File Wizard

You can also use the Flat File Wizard in the SQL Server Management Studio.

  • Navigate to the SQL Server Management Studio and locate the Database.
  • Right-click on the Database and click the Tasks option –> Click on the Import Flat File option.
Import Data Into Azure SQL Database Using the Flat File Wizard
  • On the Import Flat File Wizard, Specify the Input File and all other details to import the data into the Azure SQL Database.

FAQs

How To Migrate on Prem Database to Azure

Using the Database Migration Service, you can easily migrate your on-prem database to Azure. Below are the overall steps you need to perform below

  1. First, you need to create an instance of the Database Migration Service.
  2. The second step is to create a migration project in the Database Migration Service.
  3. Then, you must provide the Source and destination details as part of the migration.
  4. Finally, it would help if you run the migration.

Refer to the above section for more details. Export the On-premise SQL Database to Azure Now.

You may also like following the articles below

Wrapping Up

In this article, we have discussed How To Upload SQL Database To Azure and import Data Into Azure SQL Database. Thanks for reading this article !!!