Execute command
ο»Ώ
Query vs Commands: There's a basic difference between them - commands modify the data, and queries retrieve the data.
Use this action to execute a SQL command in Microsoft SQL.
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/4Cc8mVlmk7uvW66kl7YB-_image.png?format=webp)
First of all, you'll have to enter credentials for the Execute Command action. You can find out how to do that here.
ο»Ώ
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/HHT894hjOlpHEoKjQ_T_0_screenshot-2023-02-22-at-171621.png?format=webp)
How to configure the Execute Command 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 Command 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 for the database server (see here how to create one)ο»Ώ
Step 4: Click on Execute Command (not configured) card to go to the configurations steps.
Step 5: Type your SQL query in the editor.
Step 6: Add the output variable. Note: it has to be defined as a single-value object/integer.
In the output variable, you will see the number of rows affected by the executed command.
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/J0nPVi73Bv-jMBsxZHW35_screenshot-2023-02-22-at-172822.png?format=webp)
Add the output variable:
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/YZ-soEnDhYGKXbmE16UEr_screenshot-2023-02-22-at-172902.png?format=webp)
Step 7: Save, Validate and Run the process.
Step 8: Click Check Instance to view the results.
Based on our command, 2 rows were affected:
ο»Ώ
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/vC4ANdtow8kdaTCnf38AY_screenshot-2023-02-22-at-172926.png?format=webp)
ο»Ώ
![Doc contributor](https://s3.amazonaws.com/archbee-animals/koala.png)