April 21st, 2000, 12:14 PM
How difficult would it be to take a MS-SQL database and turn it into a MySQL database. can anyone tell me the exact steps of how to do this, or point me to a site that does?
April 21st, 2000, 06:07 PM
It depends on just how complicated your database is, especially if it uses stored procedures, triggers, Foreign Keys and transactions.
Stored procedures wouldn't be that hard to turn back into regular SQL, but MySQL has NO support for triggers and transactions right now, so you would have to come up with another programming method to deal with these.
If your database is fairly simple, though, it's possible, but it would take a bit of work. You would use the MSSQL Enterprise manager to generate scripts for all objects in the database, and then edit the scripts to make them compliant with MySQL, and then run the scripts in MySQL. For example the Money datatype doesn't exist in MySQL, so you would have to change Money columns to be Decimal columns with two decimals, etc...
THEN... after you have created your tables and keys in MySQL to be as close as possible to the ones in MSSQL, you would export your MSSQL data in a Comma-Delimited format and import it into MySQL.
If you don't understand half the terms I've used here, you will have quite a learning curve, but if you have a fair SQL knowledge, you will be able to figure it out. You will have to take the time to read the MySQl documentation, though.
It wouldn't surprise me if someone has written a procedure to do at least some of this automatically. (try looking at www.weberdev.com) Also, a great utility for MySQL is phpMyAdmin (at www.phpwizard.net), which provides MySQL with a web-based equivalent of the MSSQL Enterprise Manager.
Please feel free to ask some more specific questions if you decide to proceed.
Comments on this post