SQL Complete has a built-in Command Line Wizard that allows converting the options, such as searching for invalid objects or code formatting, into command-line syntax and saving them as a *.bat file with a script so you can schedule the task using Windows Task Scheduler or any other task scheduler tool.
Scheduling tasks includes the following steps:
Here, we create two batch files using the Command Line Wizard - one for the operation of searching for invalid objects and the other for the operation of formatting the code.
1. Open the Find Invalid Objects window by using one of the following options:
2. On the toolbar of the window that opens, click Save Command Line to open the Command line execution file settings dialog.
3. In the dialog that opens, select the required settings. For full information about the settings, see Command-Line Wizard.
4. Optional: To verify that the command line settings are valid, click Validate.
5. To save the script as a *.bat file, click Save. In the window that opens, specify the file name and click Save.
1. Go to the SQL Complete main menu and select SQL Formatter to open the SQL Formatter Wizard.
2. In the wizard, select a formatting mode: Files or Directories and click Next.
3. On the File list page, click Add to select the files to format and click Save Command Line.
4. In the Command line execution file settings dialog that opens, verify and configure the settings to manage the *.bat file text. For full information about the settings, see Command-Line Wizard.
5. Optional: To verify that the command line settings are valid, click Validate.
6. To save the script as a *.bat file, click Save. In the window that opens, specify the file name and click Save.
After that, you can create a scheduled task using the Windows Task Scheduler so the computer can carry out the task automatically.
To create a scheduled task, do the following:
1. Open the Task Scheduler.
2. In the Task Scheduler window that opens, navigate to the Actions pane and click Create Basic Task to create a scheduled task.
3. In the Create Basic Task Wizard that opens, specify the name and description of the task and click Next.
4. On the Trigger page, choose when to launch the task. Depending on the selected option, you’ll need to specify additional details.
5. On the Action page, click Start a program to schedule a program to start automatically and then click Next.
6. On the Start a Program page, click Browse to select the .bat file for which you want to create a scheduled task and then click Next.
There are optional fields that you can set:
7. On the Finish page, verify the settings and click Finish.
The task will be displayed in the Active Tasks section.
Repeat the instructions from the Step 2 to create a scheduled task to format code.