tags:

views:

66

answers:

3

how can I export a SQL Server table to Mysql ? I guess I need to export a .sql file compatible...

thanks

+1  A: 

One way is to BCP the data out into a CSV or some other format flat file and import those into mySQL.

Another way is to use a SSMS add-in called SSMS Tools Pack which has the option to generate insert statements.

Mladen Prajdic
I can recommended the SSMS POwer Tools pack that @Mladen Prajdichas written.
Mitch Wheat
mhm, ok given myTable and myServer, could you write down the command and where I should type it (Windows terminal ?) Sorry I'm totally new to it.
Patrick
Good plug for your tool! I'd not heard of it before but it looks very useful so I'll give it a test.
Chris W
could you elaborate a little bit more ? I've installed SSMS Tools Pack.. now how can I export my table for mySQL ?
Patrick
there are pictures that show you how on the features page. Basicaly you right click on the table or database tree node in SSMS and got to SSMS Tools -> Generate Insert statements. That's about it.Date format for teh exported SQL can be in it's Options
Mladen Prajdic
ok thanks. I'm now trying to import the file with phpmyadmin in mySql and I got error near: USE [SOData]; I guess the database is not available so it creates this problems. I thought the .sql file contained all the information I need, but it seems still related to the database. Or am I wrong ?
Patrick
only data is scripted. SSMS already has the ability to script schema, so you'll have to do with that.
Mladen Prajdic
@Mladen: I've did it with SSMS Tools indeed. And now I have my .sql file. But i cannot import it with phpmyadmin in my mysql database
Patrick
oh wait, is a problem if the mysql database is on another server ?
Patrick
well i've never imported into the mySQL, but you might try to increase the batch size to remove Raiserror messages.Different server shouldn't be a problem.
Mladen Prajdic
+2  A: 

Solution: Right Click on database Icon > Tasks > Generate Scripts follow istructions and export a specific table as .cvs

Patrick
+1 for being the only person seemingly knowing the tools already provided, while the other answers at this time get into nice disputes about additional tools - which are totally not needed.
TomTom
+1 For being the same person who did the question. lol
Patrick
A: 

please see the below link, maybe it can help you.

MSSQL to MySQL

masoud ramezani