SQL Server Query
Description
Section titled “Description”The SQL Server Query module allows executing SQL queries on Microsoft SQL Server (MSSQL) databases. It supports dynamic variables in the query and custom timeout configuration. It uses the mssql library for the connection with encryption disabled by default and trusted server certificates. It is ideal for integrations with enterprise systems that use SQL Server as their database.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | SQL Server connection credentials |
| query | code | Yes | SQL query to execute (supports {{variable}} variables) |
| timeout | number | No | Maximum wait time in milliseconds (default: 30000) |
Credentials
Section titled “Credentials”The credential must contain the fields:
host: SQL Server address (serverfield in the connection)user: Database userpassword: User passworddatabase: Database nameport: Connection port (default: 1433)
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": [ { "id": 1, "nombre": "Ejemplo", "estado": "activo" } ]}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "credentials_id": "cred_mssql_01", "query": "SELECT TOP 100 * FROM dbo.Clientes WHERE Activo = 1", "timeout": 30000}- Supports dynamic variables
{{variable}}in the SQL query - The result is returned as
result.recordset(array of objects) - The connection is configured with
encrypt: falseandtrustServerCertificate: trueby default - The connection is automatically closed on completion (finally block)
- In case of SQL error, the executed query is included in the error message
- Timeout is configurable and defaults to 30 seconds
Related Nodes
Section titled “Related Nodes”- sqlQuery (MySQL queries)
- sqlQueryPostgres (PostgreSQL queries)
- sqlQueryPostgresSSL (PostgreSQL queries with SSL)
- sqlQueryOracle (Oracle queries)