From:       To:      
Home > Documentation > Convert Access to SQL Server

Command line version of Access to SQL Server converter

To perform batch conversion or call the conversion procedure from an automation script you can use console version of Access to SQL Server converter called A2MAGENT.EXE. Find this file in the 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:

--accp=...   MS Access database password
--dest=...   SQL Server 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 SQL Server database (0 - overwrite the entire database, 1 - overwrite existing tables only, 2 - skip existing tables, 3 - merge)
--mssqlh=...   SQL Server server IP address or network name
--mssqlu=...   SQL Server user name
--mssqlp=...   SQL Server user password
--profile=...   path to a profile to load conversion settings from
--script   export MS Access data into T-SQL script file
--silent   use this option to disable program output
--skip_idx   skip converting indexes
--src=...   MS Access database name
--sysdb=...   path to MS Access workgroup information file (*.mdw)
--tab_def   convert table definitions only
--tab_file=...   name of the file containing table names to convert (one table name per line)
--uglu=...   user name for MS Access user-level security
--uglp=...   password for MS Access user-level security

In the following example the program converts MS Access database "db1" into SQL Server database "db1 from msaccess" on the remote SQL Server server "mssqlhost" using table names file "c:\tabfile1.txt":

A2MAGENT.EXE --src=c:\db1.mdb --dest="db1 from msaccess" --mssqlh=mssqlhost 
--mssqlu=administrator --mssqlp=the_passsword --tab_file=c:\tabfile1.txt

Table names file should be formatted as follows:



  1. If you specified a profile, there is no need to specify any other parameters
  2. You should omit 'sysdb', 'uglu' and 'uglp' parameters if not use MS Access user-level security
  3. You can omit 'mssqlh' parameter to connect local SQL Server server
  4. You can omit 'mssqlu' and 'mssqlp' parameters to connect to SQL Server server using Windows authentication
  5. If you omit 'tab_file' parameter, all database tables will be converted
  6. If you omit 'mode' parameter, default mode 'overwrite the entire database' will be used
  7. Command line parameters that contain spaces should be enclosed in quotes (for example --dest="my database")