This activity executes a query on a database and returns the query result in a Data Table. It executes the SQL command to get the results.
Command Type – It specifies about, how a command string gets interpreted. The following options are available, Text, Stored procedure, Table direct.
- Text - It includes the name of the stored procedure to executes in SQL parameters.
- StoredProcedure - Invokes the procedure name specified in the SQL parameter.
- TableDirect - It contains the name of the Table and gets all records from the Table. By default, it sets to Text.
Connection String – The connection string used to establish a database connection.
Database Context – Database context variable. Note: If the Database Context variable used here is returned by Connect activity then all properties (Connection String and Provider Name) related to database connection can be ignored.
Parameters – A dictionary of named parameters that are bound to the sql command. The binding is done by specifying the '@parameterName' statement in the sql command. At runtime the parameterName will be replaced with its value from the dictionary.
Provider Name – The name of the database provider used to access the database.
Query – SQL query or stored procedure to be executed.
Timeout (in MS) – Specifies the amount of time (in milliseconds) to wait for the activity to run before an error is thrown. The default value is 30000 milliseconds (30 seconds). Note: The amount of time specified in this field does not include the response time for the query result retrieval. This means the total execution time of the activity may be greater than the actual query execution time, which the TimeoutMS property applies to.
- DisplayName – Add a display name to your activity.
- Private – By default, activity will log the values of your properties inside your workflow. If private is selected, then it stops logging.
- Continue On Error – Specifies if the automation should continue even when the activity throws an error. This field only supports Boolean values (True, False). The default value is False.
Note: If this activity is included in Try Catch and the value of this property is True, no error is caught when the project is executed.
- Data Table – It stores the output of the SQL query in a Data Table variable.