How to Create a Task to Run SQL Scripts

1.    Access the Administration module.

2.    Select Integration Tasks from the Integrations option on the menu.

3.    In the Integration Tasks section, click Create Task.

4.    Select the Run SQL Script option from the list that appears (see figure below).

 

 

The system displays the form required to create the new task (see figure below).

 

 

5.    In the Name field, enter a name to identify the new integration routine.

6.    In the Status field, determine the status of the new task. If you select Active, the routine will be activated immediately after it is created. If you select Inactive, the routine will be created but will not function until it is enabled.

7.    You can create a schedule for the integration routine in the Schedule section. In the Start on field, enter a start date and a start time for the integration routine. Next, select one of the options (Daily, Weekly, Monthly, Yearly, Every minute, Hourly), to determine the frequency with which the task will be executed. The task can also be set to run only on week days or on weekends as well. In addition, it can be configured to have no end date by selecting the No end date option or configured to end by a certain date by completing the End by field. Note that some integration tasks may take more time to be executed than the option selected, which may result in performance problems.

8.    In the SQL Script field of the SQL Script Information section, enter the SQL script to extract and process data from the system database to which you have access. This data will then be stored in an external database defined during the system installation.

 

Note: The SQL script can only query and extract data from these databases and cannot make any changes in them. If a database is not specified in the script, by default the queries will be directed to an external database configured in the web.config file, which is in the installation folder for the system.

 

9.    Mark the Enable history deletion checkbox if you want the system to automatically delete the execution history of the integration task after a certain number of days.

10. In the History Retention Time (Days) field, enter the number of days after which the history will be deleted. Note that the automatic deletion of the history deletes all of the task execution entries except for the most recent one.

11. Mark the Execute immediately after saving checkbox for the system to execute the task once it is saved. For subsequent executions, the system follows the schedule set for the task.

12. When finished, click Save. If you want to quit the operation, click Cancel.

 

The system displays a success message.