Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Convert MySQL to SQL Server 2005 Express

Author  Topic 

ChoonyFish
Starting Member

4 Posts

Posted - 2007-10-03 : 09:45:56
I have a database that is in MySQL and would like to import it into SQL Server 2005 Express.

Can this be done? Any tutorials anywhere?

Thanks.

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-10-03 : 11:55:34
this can be done pretty easily. one way is to use mysqldump and use the --compatible=mssql option. this will generate a single sql file with create table statements as well as insert statements for all data.

You will most likely have to edit the resulting sql file somewhat to fix any problems that you run into when running the script against sql server.



-ec
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-10-03 : 11:55:56
also, the mysqldump reference for version 5 of mysql is here http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html



-ec
Go to Top of Page

ChoonyFish
Starting Member

4 Posts

Posted - 2007-10-04 : 03:44:51
I'll have a crack at it, thanks.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2007-10-04 : 04:07:37
Keep in mind the compatibility level of the sql server , as depending on the level , this has different requirements , for example using ";"

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com/SQL
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-10-04 : 09:36:18
quote:
Originally posted by eyechart

this can be done pretty easily. one way is to use mysqldump and use the --compatible=mssql option. this will generate a single sql file with create table statements as well as insert statements for all data.



strange that mysql makes it so easy to migrate away to another platform. you won't find ms doing those sorts of features!


elsasoft.org
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-04 : 09:44:05
advantage of open source

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

Michael Raven
Starting Member

7 Posts

Posted - 2007-10-05 : 02:40:14
With complicated databases it may took a lot of time to convert mismatched data types one by one, editing the dump file, generated by mysqldump
May be its easier to use 3d party software like
[url]http://www.sqlmanager.net/en/products/mssql[/url]
Go to Top of Page
   

- Advertisement -