This activity executes SQL statements on a database. For Update, Insert, and Delete statements, it does not return any result sets. It returns the number of rows affected by either any of the non-query statements. For all other types of statements, the return value is -1.
- 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 – TIt specifies the connection string to establish a database connection.
- Database Context – It specifies the Database context variable.
Note: If the Database Context variable used here returns by the Connect activity, it ignores all properties (Connection String and Provider Name) related to the database connection.
- Parameters – It specifies the dictionary of named parameters that are bound to the SQL command. It performs the binding by setting the '@parameter Name' statement in the SQL command. At runtime, will replace the parameter Name with its value from the dictionary.
- Provider Name – It specifies the name of the database provider used to access the database.
- Query – SQL query or stored procedure to be executed.
- Timeout (in MS) – It specifies the amount of time to wait for the activity to run before any error occurs. 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. The total execution time of the activity may be greater than the actual query execution time, to which the Timeout MS property applies..
- 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.
- Records Affected – It displays the result of the execution of the SQL command. For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. For all other types of statements, the return value is -1.