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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 import data from mysql

Author  Topic 

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2003-12-16 : 21:43:48
Hi,

I have a windows computer, with a mysql database file. Is it possible to import the database to mssql server? I haven't even installed mysql on my system yet as i'm not sure what to do from here.

tia

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2003-12-17 : 00:23:04
quote:
Originally posted by sql777

Hi,

I have a windows computer, with a mysql database file. Is it possible to import the database to mssql server? I haven't even installed mysql on my system yet as i'm not sure what to do from here.

tia



Here are a couple of possibilities:

1. Use SQL Server DTS to import the data from Mysql
2. Use mysqldump to dump the contents and table create statements to a file http://www.mysql.com/doc/en/mysqldump.html
3. Use Mysql SELECT INTO syntax to create a CSV file that you can import http://www.mysql.com/doc/en/SELECT.html

Both option 2 and 3 will probably require tweaking of the output files so SQL Server can understand them.

I used the mysqldump option to convert a mysql database to SQL server earlier this year. I chose this option because it was a small schema that we were migrating and this turned out to be very straightforward and easy method for us.


-ec
Go to Top of Page

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2003-12-17 : 23:34:25
Hi,

I already have the .sql file, so I'm assuming it was via the dump method.

The file is HUGE though, I can't even open it using any editor (500 megs about).

Ideas?
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2003-12-17 : 23:37:29
quote:
Originally posted by sql777
The file is HUGE though, I can't even open it using any editor (500 megs about).



have you tried Textpad? www.textpad.com

I have yet to find a file this thing couldn't open. If you can open and edit this beast, you will have to split it up into manageable parts that you can run separately against your new MSSQL database.

There are occasional syntax changes if this is an output file from mysqldump. Also, things like foreign keys are not supported in MySQL, so you may have a little bit of work ahead of you once you get the structure and data in place.



-ec
Go to Top of Page

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2003-12-18 : 07:27:19
Hi,

I've loaded the database back into mysql, just in case that will make things easier?

Ok so it sounds as if what your saying is that I should cut-and-past the .sql and just try it in QA.

Time to download textpad..thanks.
Go to Top of Page

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2003-12-18 : 12:09:56
Turns out textpad could not load the file (600 megs).

ideas?
Go to Top of Page
   

- Advertisement -