Working with console application
All the export options are set in configuration (*.cfg) files. A configuration (template) file can be also used in the Console version of Data Export for SQL Server.
To create a configuration (template) file, follow the instructions below:
- start Data Export Application wizard;
- set all the required options in all steps of the wizard;
- test the export process at the last step;
- save all export options in the template.
The easiest way to start Data Export for SQL Server console application is to double-click the generated *.cfg template. The other way is to enter the command line and type the appropriate command.
<path to Data Export for SQL Server console application>\MsExportC.exe TemplateFile [-B]
Stands for the path and the name of *.cfg template file to be used as the console version execution parameter
Use this parameter in the command line to run the console version of Data Export for SQL Server in the background mode
"C:\Program Files\EMS\Data Export for SQL Server\MsExportC.exe" "C:\EMS\DataImport\Example.cfg" -B
Using parameters in queries
MsExportC.exe [Template file] -[Query name]:[Parameter name]=[Value] -[Query name]:[Parameter name]=[Value] etc.
(see Using query parameters)
Note: The result of the latest task performed by Data Export for SQL Server can be found in the system variable '%ERRORLEVEL%'.
0 - successful completion;
1 - error(s) occurred during task performing;
2 - fatal error occurred. The task was not performed.
To schedule exporting:
1) launch the Scheduling Task tool that is implemented in MS Windows;
2) define the appropriate command as it is shown in example above;
3) define schedule when command should be executed;
4) save the task.