Database - SQL

Top  Previous  Next

The SQL task can execute a SQL command or a stored procedure against any database.

 

clip0045

 

Driver manager

The connection can be made either through "MSSQQLClient", "OLEDB" or "ODBC" driver. You can view your installed Windows drivers at Control Panel -> Administrative tools -> Data Sources -> Drivers. If a driver for your database is missing, you can find it on the Internet. The latest version is often found at the manufacturers website. OLEDB drivers are often considered faster but for MySQL the primary choice is the ODBC driver.

 

Connection string

Enter the connection string for your database. Remember that it must match the driver manager. Use the examples to get a hint what to write if you are unsure. Connection strings are stored in an encrypted format by VisualCron.

 

About trusted connections

 

If you want to Execute with a trusted connection in MSSQL you need to use a Credential in combination with the connection string for trusted connection. The Credential must be a valid Windows user on the local server (if database is local) or a valid user on remote server (if server is not local).

 

Select type of query SQL Text or Stored Procedure, only the active tab is saved.

 

SQL Text Query sub tab

Enter your SQL in the text window of the SQL text tab.

 

Stored Procedure sub tab

 

clip0103

 

Enter the name of the stored procedure to execute. The grid shows all parameters. When clicking on the Add button, a parameter window will open. Enter parameter values for Name, Value, Data type and Parameter direction.

 

clip0124

 

Test your SQL task before closing the VisualCron client. Errors will be reported in the log window.

 

Job sub tab

 

clip0104

 

If you want to execute a Job in the database you can specify the Job name in the text box of this tab.

 

Use this option if you want to execute a remote Package of type SSIS/DTS. You need to create a Job of your package first.

 

Some SQL task notes:

use appropriate prefix on variable, normally @variablename
take advantage of predefined connection strings
when using ODBC, remembe to add your parameters in the order you want to use them
if you have DNS connections - take advantage of them
test SQL tasks and look for error message in the log window