Command Line Wizard
Last modified: September 6, 2024
SQL Complete includes a built-in Command Line Wizard that enables you to convert options into command-line syntax, which can then be saved as a *.bat file.
This feature is designed to facilitate the scheduling and automation of database comparisons and synchronizations. You can use the *.bat file with a script and Windows Task Scheduler or any other task scheduling tool to automate these processes.
To configure the command-line file settings, open the Command line execution file settings window. You can access this window by by clicking the Save Command Line button in Find Invalid Objects window and SQL Formatter Wizard.
Find Invalid Objects Window
Here, the command line wizard has the following options:
Option | Description |
---|---|
Connection | Specifies the connection string. |
Password | Specifies the server password and overrides the values specified in the /connection parameter. |
Database | Specifies the database(s) and overrides the values specified in the /connection parameter. You can specify either a single database or multiple databases separated by commas. |
All databases | Finds invalid objects for all non-system databases specified in the /connection parameter. |
Report | Generates a report in the CSV file format. |
Log | Generates a log file and saves it in the specified folder. |
SQL Formatter Wizard
Options of the Command Line Wizard
In this case, the command line wizard has the following options:
Option | Description |
---|---|
Connection | Specifies the connection string. |
Password | Specifies the server password and overrides the values specified in the /connection parameter. |
Profile | Specifies the pass to the file that contains formatting options settings or a predefined profile name. If the parameter is not specified, default formatting options settings will be applied. |
Encoding | Specifies the encoding that should be applied to open and save files. |
Source file | Specifies the source SQL file to be formatted. |
Output file | Specifies the path to an output file where formatting results of the source file will be saved. If not specified, the results will be saved in the source file. |
Log file | Generates a log file and saves it in the specified folder. |
Command line validation
After setting the required options for the potential script, you can click Validate to check the code accuracy.
If the syntax is valid, you will receive the following message:
Otherwise, the corresponding warning will be displayed:
After validating the code, you can save the script as a *.bat file by clicking the Save button and specifying a path to its location.