Prior to running Foundation DBUtils with the compare command, you can configure the database comparison process by applying command line switches.The following command line switches can be applied when using the compare command:
Switch |
Description |
---|---|
--datasourcename |
Specifies a unique name for the connection string used to connect to the database. For more information, see --datasourcename. |
--connectionstring |
Specifies the connection string used to connect to the database. For more information, see --connectionstring. |
--provider |
Specifies the data provider type used for the database. For more information, see --provider. |
--configoverride |
Specifies the full path to a custom JSON configuration file. For more information, see --configoverride. Note:
For more information on using custom JSON configuration files with the Foundation DBUtils application, see Modifying the JSON Configuration File. |
--sql |
Generates a SQL script that corrects conflicting indexes identified during the comparison process. |
--help |
Displays help information for the preceding command. For more information, see --help. |
--verbose |
CAUTION:
This command line switch should never be applied in a production environment. The resulting logs contain detailed messages and may include sensitive data. Add the --verbose switch to set the logging level to trace. |
For example, the following compare command compares the schema of the specified database against the schema defined in the Foundation DBUtils application. In this example, connection information is provided using command line switches, and the application generates a SQL script to correct conflicting indexes identified during the comparison process:
foundationdbutils.exe compare --datasourcename "DataSourceName" --connectionstring "Data Source=Serv001\instance;database=TestDB; User Id=username;Password=password" --provider "System.Data.SqlClient" --sql
Any options specified by applying command line switches override the corresponding option specifications in any default or custom JSON configuration files.