Execute Query
Use this action to execute an SQL query in Microsoft SQL.&x20;
Query vs Commands: There's a basic difference between them - commands modify the data, and queries retrieve the data.
Use this action to execute an SQL query in Microsoft SQL.

First of all, you'll have to enter credentials for the Execute Query action. You can find out how to do that here.
How to configure the Execute Query action?
Go to the Process Designers section and open a new or an existing process. Actions configuration can be performed once they are dragged and dropped on canvas.

Step 1:ย Drag the Execute Query action from Toolbar and drop it on canvas; click on the action to open the Properties Panel.
Step 2:ย You can edit the Action Name.
Step 3: Select a credential (see here how to create one)
Step 4: Click on Execute Query (not configured) card to go to the configurations steps.
Step 5: Type your SQL query in the editor.
Note: you can always add process variables to your query. Press INSERT/Ctrl+I (Windows) or Cmd+I (Mac).
Step 6: Add the output variable. Note: it has to be defined as a list<objects>.
In the output variable, you will see the retrieved data/results based on the query.

Step 7: Save, Validate and Run the process.
Step 8: Click Check Instance to view the results.
Based on our query, a list with data was retrieved in the output variable:

Notes
Using SQL Parameters
When writing SQL queries in Execute Query, you can use SQL parameters instead of inserting variables directly inside the query text.
Parameters allow you to safely pass values from process variables to the SQL query and help prevent errors caused by special characters.
For example, instead of writing:
SELECT Id, FirstName, EmailFROM ClientsWHERE Email = '{{client.email}}'
You can define a parameter:
SELECT Id, FirstName, EmailFROM ClientsWHERE Email = @email
Then map the parameter in the configuration panel shown above:
| Parameter | SQL Type | Value |
|---|---|---|
| NVarChar | {{client.email}} |
Using parameters is recommended because it:
- prevents SQL errors when values contain characters like '
- improves query security
- keeps SQL statements easier to read
- works better with dynamic process variables
If the mapped value is null, PROCESIO automatically sends a SQL NULL value to the database.


