The easiest way to do this is using a Script generated by SQL Server Management Studio with the data we want to migrate.
Generating the Data Insertion Script
For that we must do the following:
- Go to our local database in SQL Server Management Studio
- Right click on the database
- Select Task> Generate Scripts …
- You should get the following:
4.1. If you want to extract all data from all tables, select “Script entire database and all database objects”, otherwise, select “Select specific database objects” and select the tables from which you want to extract data.
5. Press Next
6. Press Advanced.
7. In Script USE DATABASE select False, and in Types of data to script, select Data only and press Ok:
8. Select “Save to new query window” and press Next twice.
9. Press Finish
Inserting the Data in the Azure Database
We are then going to insert this data into the Azure database. One way to do this is to go to the database in Azure and run the script right there.
- Go to https://portal.azure.com/
- Go to your database.
- Click on Query Editor (preview)
- Enter your credentials. If you get an IP message, click on the link below:
5. Click Ok to enter your database.
6. In the Queries Editor, place the query and press Run:
That’s it, with this you have inserted the desired data in Azure.
If you want to learn more about software development, buy one of my courses today:
- Building Applications with Angular 11 and ASP.NET Core 5: https://www.udemy.com/course/building-applications-with-angular-and-aspnet-core/?couponCode=JUNE2021
- Programming in Blazor – ASP.NET Core 5: https://www.udemy.com/course/programming-in-blazor-aspnet-core/?couponCode=JUNE2021
- Building RESTful Web APIs with ASP.NET Core 3.1: https://www.udemy.com/course/building-restful-web-apis-with-aspnet-core/?couponCode=JUNE2021
- Introduction to Concurrency in C# – Async and Paralellism: https://www.udemy.com/course/introduction-to-concurrency-in-c-async-and-paralellism/?couponCode=JUNE2021