The command line uses an xml config file for all comparison options and settings. The xml file allows you to:
The xml config file contains the following sections:
Section | Description |
---|---|
Database | Use this element to specify SQL Server databases, credentials or the snapshots containing the schema that should be compared. |
Comparison Options | Use these elements to select or exclude comparison options. |
Object Type Selection | Use this element to include or exclude database objects by type. |
Object Selection | Use this element to include or exclude database objects by name. |
Schema Filters | Use these elements to specify schema filters. A schema filter allows you to include or exclude database objects based on matching criteria. |
Filegroup Settings | Use this element to specify the filegroup options. |
Filestream Filegroup Settings | Use this element to specify the filestream filegroup options. |
Object Mappings | Use this element to specify the mapping type for various database objects. Command line supports mappings by name or schema and name. |
Command Line Settings | Use this element to specify various comparison settings such as the output files, the target database, whether databases should only be compared or compared and synchronized, and more. |
The following is a typical xml config file:
<?xml version="1.0" encoding="utf-8" ?>
<CommandLineParameters xmlns="http://www.xsql.com/sqlschemacmd.xsd">
<LeftDatabase>
<SqlServer>(local)</SqlServer>
<DatabaseName>Left_DB</DatabaseName>
<TrustedConnection>true</TrustedConnection>
</LeftDatabase>
<RightDatabase>
<SqlServer>(local)</SqlServer>
<DatabaseName>Right_DB</DatabaseName>
<TrustedConnection>true</TrustedConnection>
</RightDatabase>
<CommandLineSettings>
<SchemaScriptFile>script.sql</SchemaScriptFile>
<SchemaLogFile>log.txt</SchemaLogFile>
<SchemaWarningsFile>warnings.txt</SchemaWarningsFile>
<ErrorLogName>error.txt</ErrorLogName>
<CompareSchema Direction="RightAsLeft" Synchronize="true"></CompareSchema>
</CommandLineSettings>
</CommandLineParameters>
This config file forces the command line to perform the followings:
<SchemaScriptFile>
element.<SchemaLogFile>
element.<SchemaWarningsFile>
element.<ErrorLogName>
element.<CompareSchema>
. The command line will generate a script that makes the Right_DB the same as the Left_DB.<CompareSchema>
. By default the command line generates the synchronization script, but does not execute it.The following command performs a schema comparison using the settings in config.xml:
xSQLSchemaCmd config.xml
The following command validates the file config.xml:
xSQLSchemaCmd config.xml /v
The xml elements and attributes are case-sensitive. |
Total compare from data to schema with IDERA SQL Comparison Toolset. Learn more > > |
IDERA Website | Products | Purchase | Support | Community | About Us | Resources | Legal |
---|