Pregunta

This question is the exact opposite of Converting MySQL DDL to SQL Server DDL.

I have a SQL Server 2008 DDL file. I want to import it into MySQL.

Is there any tool or suggestion to achieve this?

¿Fue útil?

Solución

One could use Navicat Premium in combination with a real instance of MSSQL and MySQL.

  1. Create connections to both DBs
  2. Import the DDL to the real SQL Server instance
  3. Right click the SQLServer DB, then use Data Transfer... wizard
  4. In left panel, select SQL Server connection, database and schema to transfer
  5. In right panel, select MySQL connection and database
  6. Click Start

I found that my DDL spans across multiple schemas. I had to merge all the tables in one schemas repeating the transfer for each source schema to the target database. AFAIK this is due to the nature of SQL Server VS MySQL, where the former defines a tree structure Server->Database->Schema and the latter only Server->Database, where actually database is a synonim of schema.

Unfortunately, this looked like not transferring foreign keys declarations to the target database.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top