MsSQL export

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
user___
Forum Contributor
Posts: 297
Joined: Tue Dec 05, 2006 3:05 pm

MsSQL export

Post 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.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post 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.
Post Reply