Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export data from SQL Server 2005 to MySQL [closed]

I've been banging my head against SQL Server 2005 trying to get a lot of data out. I've been given a database with nearly 300 tables in it and I need to turn this into a MySQL database. My first call was to use bcp but unfortunately it doesn't produce valid CSV - strings aren't encapsulated, so you can't deal with any row that has a string with a comma in it (or whatever you use as a delimiter) and I would still have to hand write all of the create table statements, as obviously CSV doesn't tell you anything about the data types.

What would be better is if there was some tool that could connect to both SQL Server and MySQL, then do a copy. You lose views, stored procedures, trigger, etc, but it isn't hard to copy a table that only uses base types from one DB to another... is it?

Does anybody know of such a tool? I don't mind how many assumptions it makes or what simplifications occur, as long as it supports integer, float, datetime and string. I have to do a lot of pruning, normalising, etc. anyway so I don't care about keeping keys, relationships or anything like that, but I need the initial set of data in fast!

like image 297
Mat Avatar asked Aug 01 '08 16:08

Mat


People also ask

How do I export a SQL 2005 database?

To export the data, you can: Right mouse click on your database >> tasks >> export data. or copy/paste from/to table data view.

How do you transfer data from Microsoft SQL Server to MySQL?

Select “Microsoft SQL Server” from the drop-down list of database systems. On the Options tab, select DSN and specify the user name in the database. Next, define a target connection to a MySQL database in the Options tab. Select “Local MySQL instance” or “Remote MySQL instance” depending on the situation.

Can you restore a SQL 2005 database to SQL 2019?

It's not true. You can backup+restore (safest way) or detach+attach (not a safe way) from SQL Server 2005 (or higher) to any other newer version. You just can't do an in-place upgrade to the latest version from SQL Server 2005.


1 Answers

The best way that I have found is the MySQL Migration Toolkit provided by MySQL. I have used it successfully for some large migration projects.

like image 80
Nick Berardi Avatar answered Sep 18 '22 16:09

Nick Berardi