Page 1 of 1

MsSQL export

Posted: Fri Aug 03, 2007 3:41 am
by user___
Hi guys,
I have a MsSQL server and I need to extract a table from it and put it in MySQL. Is there any way this to be done?

BTW:Is there any way to import it in MySQL from an XML file.

Posted: Fri Aug 03, 2007 2:46 pm
by califdon
I'm sure MsSQL has a command to dump a table definition and data records. Then you can just do a LOAD DATA INFILE ...

A dump file contains SQL commands. It usually starts with a DROP TABLE xyz, in case a table with that name already exists in the destination database, followed by a complete CREATE TABLE ... command to set up the new table and all its columns. Then there are INSERT INTO ... commands for every record in the original table.

I'm not very familiar with MsSQL, so you'll need to research that, or perhaps someone else can answer that.

As to your second question, I'm not aware of a direct way to import from XML, but a script could certainly be written to do that, and quite likely someone has written such a script.