Rahsaz MSSQL icon

Rahsaz MSSQL

RahsazMSSQL Methods

Overview

This node provides CRUD (Create, Read, Update, Delete) operations on Microsoft SQL Server tables via two different primary database connections ("Click" and "PayamGostar"). It allows users to specify the target table and perform operations such as retrieving a record by ID, inserting new records, updating existing ones, or deleting records. Additionally, it supports merging results with input data and handling relational dependencies when fetching data.

Common scenarios include:

  • Integrating n8n workflows with MSSQL databases for data synchronization.
  • Automating updates or inserts into specific tables based on workflow inputs.
  • Fetching detailed records including related data from joined tables.
  • Managing data consistency across related tables using dependency resolution.

Example use case: Updating a customer record in a sales database by specifying the table name, record ID, and fields to update.

Properties

Name Meaning
Primary Selects the primary database connection to use; options are "Click" or "PayamGostar".
Table The name of the database table on which the operation will be performed.
ID The unique identifier of the record to get, update, or delete. Required for these operations.
Merge? Boolean flag indicating whether to merge the output with the input data (true or false).
Fields Collection of column-value pairs representing the fields to create or update in the record.

Output

The node outputs JSON arrays representing the result of the database operation:

  • For Get operations, it returns an array of objects representing the selected rows, optionally including joined relational data if configured.
  • For Create operations, it returns the inserted record's generated ID (either GUID or identity).
  • For Update and Delete operations, it returns the affected rows or confirmation of the operation.
  • If "Merge?" is enabled, the output merges the original input properties with the database response under a props key.

No binary data output is produced by this node.

Dependencies

  • Requires valid credentials for two MSSQL database connections ("Click" and "PayamGostar") and one PostgreSQL connection for dependency resolution.
  • Uses helper functions to execute SQL queries against MSSQL and PostgreSQL databases.
  • The node expects environment setup with appropriate access rights to the specified databases and tables.

Troubleshooting

  • Empty results on Get: Ensure the provided ID exists in the specified table. Also verify that relations and dependencies are correctly configured if used.
  • Insert/Update failures: Check that all required fields are provided and that field names match the database schema exactly.
  • Credential errors: Confirm that the API keys or authentication tokens for the MSSQL and PostgreSQL connections are valid and have sufficient permissions.
  • Timeouts or delays: Dependency resolution may retry queries after delays if forced lookups fail initially; ensure network connectivity and database responsiveness.
  • SQL Injection risk: Since values are interpolated directly into queries with simple quoting, avoid passing untrusted input to prevent injection vulnerabilities.

Links and References

Discussion