Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Use the SQL component

Write custom SQL queries to perform various operations by using the SQL component in RPA Desktop Design Studio.

Before you begin

Role required: none

About this task

You can configure the properties for the SQL component. For more information about these properties, see Properties of the General components.

Procedure

  1. In the Toolbox pane, navigate to General > SQL.

  2. Drag the SQL component to the Design surface.

  3. Click the component settings icon (

Image omitted: component-settings-icon.png
Component settings icon.\).
  1. Under the SCRIPT (SQL) heading, write the custom SQL query.

  2. To add a parameter to the query, do the following.

    1. Click the add parameter icon (
Image omitted: add-image-icon.png
Add parameter icon.\).
2.  Update the data type of the parameter.

3.  Repeat the steps to add more parameters.

A Data In Port is added with each parameter you add.
  1. Click OK.

  2. To configure the input fields, see Configure port properties.

  3. To close the PORT PROPERTIES dialog, click OK.

  4. Connect the data and control ports of the SQL component to the corresponding ports of the other component as described in the following table.

ParameterDescriptionData Port type
Connection Provider

Takes the data table connection provider that enables an application to communicate with a database.- Example:

SqlClient, MySqlClient

Data In
Connection String

Connection string helps in connecting to the required data source using the details, such as server name, username, and password. In the following connection strings for each authentication type, replace the placeholder parameter values (for example, <myUser> and <myPassword>) with actual values:- Example:

For SQL authentication:



</code></pre>
<p>Server=<MY_SERVER>;Database=<MyDatabase>;User Id=<myUser>;Password=<myPassword>;

    ```</p>
<p>For Windows authentication:</p>
<pre><code>

Server=MY_SERVER;Database=MyDatabase;Trusted_Connection=True; ```

For Oracle database:



</code></pre>
<p>Data Source=MyTnsName;User Id=myUsername;Password=myPassword;

    ```</p>
<p>For MySQL database:</p>
<pre><code>

Server=MY_SERVER;Database=MyDatabase;User Id=myUsername;Password=myPassword; ```

For ODBC database:



</code></pre>
<p>Driver={SQL Server};Server=MY_SERVER;Database=MyDatabase;Uid=myUsername;Pwd=myPassword;

    ```</p>
<p>For OLEDB database:</p>
<pre><code>

Provider=SQLOLEDB;Data Source=MY_SERVER;Initial Catalog=MyDatabase;User Id=myUsername;Password=myPassword; ```

Data In
ParameterTakes the value of the parameter from a previously executed component.Data In
DataTableReturns the data table and passes to the next component.Data Out
  1. To view the output, right-click the Return field and click Preview Data.

  2. To test the component, under the DESIGN tab, click Run.

Parent Topic:General