[Automise Professional Edition]

Execute an SQL statement against Microsoft SQL Server and capture the result set.

On this page:

 

Connection & Security

SQL Server

Server

Specify the MS SQL Server to use.  Clicking "View List" will attempt to locate any SQL Servers on the network.

Use database

Specify a database to run the SQL against.

SQL Server Tool

Choose the method (isql, osql or sqlcmd) to use to connect with.

ISQL

The isql utility allows you to enter Transact-SQL statements, system procedures, script files, and uses DB-Library to communicate with SQL Server.

OSQL

The osql utility allows you to enter Transact-SQL statements, system procedures, and script files. This utility uses ODBC to communicate with the server.

SQLCmd

The sqlcmd utility lets you enter Transact-SQL statements, system procedures, and script files at the command prompt, in Query Editor in SQLCMD mode, in a Windows script file or in an operating system (Cmd.exe) job step of a SQL Server Agent job. This utility uses ODBC to execute Transact-SQL batches.

Security

If not using integrated (ie. Windows) security, you should specify the username and password to use.

Use integrated security 

Use Windows Authentication mode for login. This requires that the user running the Automise project has access to the SQL server and instance in question. 

Username

The username to use for connecting to the SQL server. 

Password

The password to use for connecting to the SQL server.

Login Timeout

The number of seconds that will be allowed to pass, waiting for a result. If this timeout elapses and no result is returned then the action will fail. 

Enabled quoted identifier

Sets the QUOTED_IDENTIFIER option to ON for the duration of the SQL statement being run. 

Input

SQL Input

SQL Script from file

Specify a file that contains an SQL script.

Text query

Specify the SQL query to execute.

Variables

Name

The name of the variable in the SQL script. Typically used for stored procedures. 

Value

The value the SQL variable should be given. 

Output

The query results can either be output to a file or to the Automise Log.

SQL Output

Output to log

Specify this option to only report the results of the SQL statement execution to the build log. Useful when the script is performing an action, rather than returning a dataset. 

Output to file

Specify this option to save the output from the SQL statement execution to a log file. 

Column width

The number of characters present in each column. This is global to all columns in the generated report. If specific widths are required for each column this will have to be done in separate actions. 

Maximum data to return

Only required for isql executions. Specify this value to set the limit of data returned by the execution. The default is 4k characters. 

Don't output headers

Specify this option if column headers should not be included. Useful when the report is going into another table, or data structure where skipping the headers is required. 

Output SQL query to log

Output the SQL query, which was run, to the build log. Helpful for debugging Automise variable values which are determined at runtime. 

Options

Options

Column separator char

Specify the preferred column separator. Typically its best to choose the separator that is easiest for subsequent actions or tools to deal with. 

Command terminator

Specify the command terminator that should be used with the SQL server. This command terminator is used to signal the script is complete and should be executed. 

Set message error level

Specify this option if the error message level is to be set. If not set then all error messages are reported. 

Error level

Sets the SQLCMDERRORLEVEL variable. But default this is set to zero. All error which have a value higher than this level are reported. 

Action fails when an error occurs

If an error is detected then the action will be reported as failed. If the actions result is not ignored, this will stop the build from proceeding. 

Query timeout

Run indefinitely

Specify this option if the action should wait indefinitely for the result of the SQL statement. 

Set timeout

Specify this option for the action to wait the specified number of seconds for the statement to return. If the timeout elapses and the statement has not returned, then the action will report as failed. 

  • No labels