Microsoft SQL Server - Execute a query

Use the Microsoft SQL Server - Execute a query action A tool for building the processes, logic, and direction within workflows. to run queries in a database you specify. A query can be a request for data or for action.

For example, you want to generate a directory of your customers' email addresses. To achieve this, you need to retrieve the email addresses from your company database. By using the Microsoft SQL Server - Execute a query, you can retrieve these data, store them in variables, and then insert in a Generate document action.

Before you start 

Configure the Microsoft SQL Server - Execute a query action

In the Designer page: 

  1. Click the Microsoft SQL Server action group in the action toolbox.

    or

    Find actions by browsing action groups or by typing an action name or function in the Search field at the top of the action toolbox.

  2. Drag the Microsoft SQL Server - Execute a query action to the point in the workflow when you want to execute a query.
  3. Click the Microsoft SQL Server - Execute a query action.
  4. Select a Connection.

  5. Caution: Make sure to first configure your database's firewall to allow your workflow to connect to your database. For more information on source IP addresses you can use, see Connectors.

  6. In SQL script, type the statement to run a query on your database. For example: SELECT * FROM [Customers]
  7. For more guidance on SQL keywords, see SQL Keywords Reference.

  8. In Column to retrieve, type the database column that contains the values you want to retrieve. For example, "Email address".

For more information on the fields and buttons, see Microsoft SQL Server - Execute a query fields, and settings.