views:

443

answers:

3

I have a .sql file from a MySQL dump containing tables definitions and the data to be inserted in this tables. How can I convert this database represented in the dump file into a MS SQL server database?

+1  A: 

If you do an export with PhpMyAdmin, you can switch sql compatibility mode to 'MSSQL'. That way you just run the exported script against your MS SQL database and you're done.

If you cannot or don't want to use PhpMyAdmin, there's also a compatibility option in mysqldump, but personally I'd rather have PhpMyAdmin do it for me.

Marga Keuvelaar
@marga, it didn't worked for MS SQL 2008.
marionmaiden
+1  A: 

I suggest you to use

mysqldump --compatible=mssql

since phpMyAdmin is still a web-app and could have some particular limitations for large databases (script execution time, allocatable memory and so on).

deklin
@deklin, it didn't worked for MS SQL 2008.
marionmaiden
A: 

I found a way for this on the net

It demmands a little bit of work, because it has to be done table by table. But anyway, I could copy the tables, data and constraints into a MS SQL database.

Here is the link

http://www.codeproject.com/KB/database/migrate-mysql-to-mssql.aspx

marionmaiden