Activities




Connect to MSSQL

This activity connects to a Microsoft SQL Host. The Output of this activity should be used as input for all Connection parameters used for activities placed under Microsoft SQL category.


NOTE: If during the execution of the workflow, the connection expires, the activity will attempt three times to automatically reconnect to Microsoft SQL host using the input credentials. 

Activity Parameters

The Connect to MSSQL activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:

The Read Only Output variable are the possible output values that the activity will provide:

 





Disconnect from MSSQL

This activity disconnects from a Microsoft SQL Host.

Activity Parameters

The Disconnect from MSSQL activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:



Add User Access to Database

This activity adds privileges for an user to a database.

Activity Parameters

The Add User Access to Database activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:

 

Execution: the activity will check if the user exists as a login on the SQL server and if found, will grant access on the connected database, for the given roles:



 

Backup Database

This activity creates a backup .bak file of a selected database.

Activity Parameters

The Backup Database activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:

 

Execution: the activity will create a backup file of the database settled in the connection activity, in the specified folder:



The backup file can be seen in the given location:




Delete Row(s) from Table

This activity deletes Row(s) from a SQL Server database table.

Activity Parameters

The Delete Row(s) from Table activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:

Execution: the activity will delete all the rows from a table according to the given Where statement:


 


Insert Row into Table

This activity inserts Row on a SQL Server database table.

Activity Parameters

The Insert Row into Table activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:

The Read Only Output variable are the possible output values that the activity will provide:

 

Execution: the activity will insert the new row into the selected table and will output the ID of the added row:



In the database, the row can be seen at the last position:


 


Remove User Access from Database

This activity removes privileges for an user to a database.

Activity Parameters

The Remove User Access from Database activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:



Execution: the activity will check if the user exists as a login on the SQL server and if found and if it already have assigned rights to the database where the activity is connected to. If the user is found and has rights over the database,  the activity will revoke access on the connected database, for the given roles:


 


Restore Database

This activity restores a Database from a backup .bak file.

Activity Parameters

The Restore Database activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:

 


 


Run query

This activity runs a query on a SQL Server database.

Activity Parameters

The Run Query activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:

NOTE: if query returns a column of Date type, the format of the date returned as a string will be taken from the execution server.

The Read Only Output variable are the possible output values that the activity will provide:

 

NOTE: if user-defined messages are desired to be returned and displayed by the Run Query activity, the command(s) can be written by following the example below:

DECLARE @firstMessage char(20);
DECLARE @secondMessage char(20);
SET @firstMessage='The selected category exists in the database';
SET @secondStatus = 'The selected category does not exist in the database';

IF (EXISTS (SELECT name FROM Category where name='Approval Tasks'))
SELECT @firstMessage;
ELSE
SELECT @secondMessage;



Execution: In the Tracking Data there can be seen the returned results:


The same result can be seen when executing the same SQL Select query from SQL Management Studio:




Select Row(s) from Table

This activity selects and returns Row(s) from a SQL Server database table. The example below displays a classic select query: select all data from a given table.

Activity Parameters

The Select Row(s) from Table activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:


The Read Only Output variable are the possible output values that the activity will provide:

 


A more complex example, with fields, orders and statements can be seen in the image below:

Execution: In the Tracking Data there can be seen the returned results:


The same result can be seen when executing the same SQL Select query from SQL Management Studio: