Task Database - SQL

Top  Previous  Next

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

 

clip0042

 

Connection

The information about database, connection string and provider type are stored in Connections. Create a SQL Connection and select it in the Task.

 

Credential and trusted connections

If you want to Execute with a trusted connection in MSSQL you need to use a Credential in combination with the Connection 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).

 

Timeout

Timeout in seconds before the query should exit.

 

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

 

clip0043

 

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.

 

clip0177

 

Validate value

If this value is checked VisualCron will validate the value against the value type. Unselect this if you are using a Variable as value and this Variable is not yet set.

 

 

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

 

Job sub tab

 

clip0044

 

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.

 

Output tab

The output tab controls how the date should be output:ed from the SQL Task.

 

clip0175

 

Include field names

If the columns should be included in the output or not.

 

Field separator

Here you can control what separates each field.

 

Text qualifier

The text qualifier is the parts surrounding a field. Normally nothing which is default.

 

Line break

Controls what type of line break should be used.

 

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