Skip to content

SQL Server

SQL Server works with the tables of your Microsoft SQL Server database from a flow: it reads rows, adds new ones, changes or deletes existing ones, runs SQL queries and describes the database structure.

When to use it

  • Your ERP or CRM keeps its data in SQL Server and you want to query it from a flow.
  • Giving an agent access to look up customers, orders or stock.
  • Updating a specific record from its key.

Configuration

The Operation field decides what the component does and which fields appear: Insert (default), Get, Update, Delete, Custom Query, Get Schema (lists the tables or a table’s columns) and DatabaseInfo (describes the database). Once you pick the credential, Schema and Table Name fill with your database’s.

You need a SQL Server credential with the server, port, user, password and database. See Credentials.

FieldWhat it does
Credential (required)The SQL Server credential with the connection details.
Operation (required)What the component does.
Schema (required)The schema that holds the table.
Table Name (required)The table to work on.
Use FiltersTurn it on to choose which rows are read, changed or deleted. When on, Selection Mode appears: By Primary Key (by key, with Primary Key Value) or By Filters (by conditions).
Primary Key ValueThe key value of the row to change or delete.
Select Filter TypeHow you write the conditions: String (default), in Filter String, or Build Manually, with Number Of Filters To Use and one field per condition.
Filter StringThe conditions, for example age > 25 AND city = 'Madrid'. Empty with Get, every row is returned.
Custom Query (required)With Custom Query. The SQL query to run.
Detail LevelWith Get Schema. Tables (default) returns the table names; Columns, the column details of the table chosen in Table.

Advanced options

FieldWhat it does
LimitThe maximum number of rows returned. Default: 10.
Return AllReturns every row regardless of Limit. Off by default.

Output

The Data output holds the operation’s result: the rows read or confirmation of what changed. The Database Info output holds the database description.

In tool mode, an agent can use the component to look up or change data by itself. See Tool Mode.

Example

A distributor wants its assistant to check stock in its ERP.

  1. Add SQL Server with the SQL Server credential.
  2. Choose Get, the dbo schema and the items table.
  3. Put it in tool mode so the agent writes the condition in Filter String.

Good practices

  • Use a read-only credential if the component will only look things up.