Extract the tables and data from MySQL into a .SQL file. Follow the directions in the article on how to backup our MySQL or MariaDB database. This will create a file, such as example.sql. Open the file, and you will see blocks of SQL syntax. Following is an example of the type of syntax you should expect to see in the SQL file.
Changes need to be made to the .sql file, because there are differences between MySQL and Microsoft SQL Server. Do the following for the CREATE TABLE statement. The changes can be done in a text editor, such as Notepad or Notepad++.
Do the following for the INSERT INTO statement.
Follow these steps to create the tables and data in Microsoft SQL Server, using the SQL file from MySQL.
- Sign into SQL Server using SQL Server Management Studio.
- In the top navigation bar, select New Query
- Copy the text in the example.sql file, and paste the text into the middle area of SQL Server Management Studio
- In the top navigation bar, select Execute