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:

SectionDescription
Database
   <LeftDatabase>
   <RightDatabase>
Use this element to specify SQL Server databases, credentials or the snapshots containing the schema that should be compared.
Comparison Options
   <ComparisonOptions>
Selected Comparison Options
   <SelectedComparisonOptions>
Excluded Comparison Options
   <ExcludedComparisonOptions>
Use these elements to select or exclude comparison options.
Object Type Selection
   <ObjectTypeSelection>
Use this element to include or exclude database objects by type.
Object Selection
   <ObjectSelection>
Use this element to include or exclude database objects by name.
Schema Filters
   <SchemaFilters>
Schema Filter Expressions
   <SchemaFilterExpressions>
Use these elements to specify schema filters. A schema filter allows you to include or exclude database objects based on matching criteria.
Filegroup Settings
   <FileGroupSettings>
Use this element to specify the filegroup options.
Filestream Filegroup Settings
   <FileStreamFileGroupSettings>
Use this element to specify the filestream filegroup options.
Object Mappings
   <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
   <CommandLineSettings>
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:

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 WebsiteProductsPurchaseSupportCommunityAbout UsResources Legal