filmov
tv
How to Quickly Convert a MySQL Database to SQL Server (for FREE)

Показать описание
Leave a LIKE if you found this tutorial useful and SUBSCRIBE for more coding videos.
In this video I show you a super quick way of converting a MySQL database to SQL Server. This includes migration of both the table schema (structure) as well as migrating the data.
The tool you need for this is called the SQL Server Migration Assistant for MySQL (MySQLToSQL) and you can find it here (it's a free download):
As you might have realised from the video this tool is *VERY* confusing at first and it took me a few goes to get it working properly. These are the steps I used when converting my MySQL databases using the SQL Server Migration Assistant for MySQL:
1. File, New Project
2. Connect to MySQL
3. Connect to SQL Server
4. Right click on MySQL table(s) and select 'Convert Schema'
5. Once you've done all your tables click on the SQL Server side of the tool and save the script to generate the tables.
6. Run this script in SQL Server Management Studio and check your tables have actually been created.
7. Go back to SQL Server Migration Assistant for MySQL, right click on a table and transfer the data.
8. Check in SQL Server Management Studio to ensure all your tables and data look OK. You might need to recreate primary keys, relationships and indexes. Also remember SQL Server and MySQL use different systems for Full-Text indexing.
About the only issue I found when I last converted a database was that my tinyint fields were converted to smallint but I changed them manually to bit fields in SQL Server Management Studio.
Should you convert your database from MySQL to SQL Server? I used to prefer MySQL because web hosting was much cheaper, but now that's no longer the case. I found that MySQL was really unreliable on the hosting company I currently use. I don't know if it's a problem with MySQL or just my websites' server itself. This tool is also useful if you have a MySQL site you'd like to migrate to Azure or maybe AWS.
If you get any problems with converting your database from MySQL to SQL Server then leave a comment below and maybe somebody can help. Also let us know if there's an even easier way of doing it!
I should also add that MySQL Workbench is RUBBISH at exporting data to SQL Server so don't even try! I didn't get the various SQL Server importers/exporters to work with MySQL either.
Finally I should also say that I used the tool with MySQL and SQL Server Express both being hosted on my desktop - you may run into problems using the tool if your databases are hosted somewhere else (especially on a shared hosting plan). If this is the problem then use your local PC first. It's then really easy to copy data from one SQL Server to another using Import/Export in SQL Server Management Studio (right click on the database you want to import or export).
I'm Brett and I've been a professional coder since 1997, mostly on the Microsoft tech stack. I've also taught English and computer programming degree courses at universities in China.
If you want me to make a video about any coding topic then leave suggestions in the comments below.
In this video I show you a super quick way of converting a MySQL database to SQL Server. This includes migration of both the table schema (structure) as well as migrating the data.
The tool you need for this is called the SQL Server Migration Assistant for MySQL (MySQLToSQL) and you can find it here (it's a free download):
As you might have realised from the video this tool is *VERY* confusing at first and it took me a few goes to get it working properly. These are the steps I used when converting my MySQL databases using the SQL Server Migration Assistant for MySQL:
1. File, New Project
2. Connect to MySQL
3. Connect to SQL Server
4. Right click on MySQL table(s) and select 'Convert Schema'
5. Once you've done all your tables click on the SQL Server side of the tool and save the script to generate the tables.
6. Run this script in SQL Server Management Studio and check your tables have actually been created.
7. Go back to SQL Server Migration Assistant for MySQL, right click on a table and transfer the data.
8. Check in SQL Server Management Studio to ensure all your tables and data look OK. You might need to recreate primary keys, relationships and indexes. Also remember SQL Server and MySQL use different systems for Full-Text indexing.
About the only issue I found when I last converted a database was that my tinyint fields were converted to smallint but I changed them manually to bit fields in SQL Server Management Studio.
Should you convert your database from MySQL to SQL Server? I used to prefer MySQL because web hosting was much cheaper, but now that's no longer the case. I found that MySQL was really unreliable on the hosting company I currently use. I don't know if it's a problem with MySQL or just my websites' server itself. This tool is also useful if you have a MySQL site you'd like to migrate to Azure or maybe AWS.
If you get any problems with converting your database from MySQL to SQL Server then leave a comment below and maybe somebody can help. Also let us know if there's an even easier way of doing it!
I should also add that MySQL Workbench is RUBBISH at exporting data to SQL Server so don't even try! I didn't get the various SQL Server importers/exporters to work with MySQL either.
Finally I should also say that I used the tool with MySQL and SQL Server Express both being hosted on my desktop - you may run into problems using the tool if your databases are hosted somewhere else (especially on a shared hosting plan). If this is the problem then use your local PC first. It's then really easy to copy data from one SQL Server to another using Import/Export in SQL Server Management Studio (right click on the database you want to import or export).
I'm Brett and I've been a professional coder since 1997, mostly on the Microsoft tech stack. I've also taught English and computer programming degree courses at universities in China.
If you want me to make a video about any coding topic then leave suggestions in the comments below.