To perform batch conversion or call conversion procedure from an automation script you can use console version of MySQL to SQL Server converter called S2MAGENT.EXE. Find this file in MySQL to SQL Server converter installation folder. You can either run this tool directly from command line or call it from any script as well. The program supports the following command-line options:
--as_dbo | connect to MS SQL server as database owner | ||
--blob2text | convert BLOB to text | ||
--dest=... | MS SQL database name | ||
--help | display help message and exit | ||
--logfile=... | path to the logfile where execution traces will be written | ||
--mode=... | how to process an existing MS SQL database (0 - overwrite the entire database, 1 - overwrite existing tables only, 2 - skip existing tables, 3 - merge, 4 - synchronize) | ||
--mssqlh=... | MS SQL server IP address or network name | ||
--mssqlu=... | MS SQL user name | ||
--mssqlp=... | MS SQL user password | ||
--mysqlh=... | MySQL server IP address or network name | ||
--mysqlu=... | MySQL user name | ||
--mysqlp=... | MySQL user password | ||
--port=... | MySQL port | ||
--script | export MySQL data into T-SQL script file | ||
--silent | use this option to disable program output | ||
--skip_idx | skip converting indexes | ||
--src=... | MySQL database name | ||
--tab_def | convert table definitions only | ||
--tab_file=... | name of the file containing table names to convert (one table name per line) | ||
--views | convert MySQL views into MS SQL |
In the following example the program converts MySQL database "db1" on the remote MySQL server "mysqlhost" to local MS SQL database "db1_from_mysql" using table names file "c:\tabfile1.txt":
S2MAGENT.EXE --src=db1 --dest=db1_from_mysql --mysqlh=mysqlhost --mysqlu=administrator --mysqlp=the_passsword --tab_file=c:\tabfile1.txt
Table names file should be formatted as follows:
Table_1
Table_2
...
Table_N
Notes:
Have questions? Contact us