Skip to content

SQL Server Query

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.

ParameterTypeRequiredDescription
credentials_idcredentialsYesSQL Server connection credentials
querycodeYesSQL query to execute (supports {{variable}} variables)
timeoutnumberNoMaximum wait time in milliseconds (default: 30000)

The credential must contain the fields:

  • host: SQL Server address (server field in the connection)
  • user: Database user
  • password: User password
  • database: Database name
  • port: Connection port (default: 1433)
{
"nextModule": "siguiente_modulo",
"data": [
{ "id": 1, "nombre": "Ejemplo", "estado": "activo" }
]
}
{
"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: false and trustServerCertificate: true by 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
  • sqlQuery (MySQL queries)
  • sqlQueryPostgres (PostgreSQL queries)
  • sqlQueryPostgresSSL (PostgreSQL queries with SSL)
  • sqlQueryOracle (Oracle queries)