Skip to content

SQL Server Execute

Executes non-SELECT SQL commands (INSERT, UPDATE, DELETE, and DDL) against a Microsoft SQL Server database using configured MSSQL credentials. Returns human-readable text and structured outputs suitable for downstream workflow steps.
Preview

Usage

Use this node to modify data or manage schema in SQL Server during a workflow. Typical examples include inserting new rows, updating existing data, deleting records, or running DDL (e.g., CREATE TABLE). Provide a valid credentials_path, set a timeout, and supply the SQL statement in sql_text.

Inputs

FieldRequiredTypeDescriptionExample
credentials_pathTrueSTRINGPath or reference to stored MSSQL credentials that follow the 'mssql' credential template.
timeoutTrueINTMaximum time in seconds to wait for the execution to complete before timing out.60
sql_textTrueSTRINGSQL statement to execute (intended for INSERT/UPDATE/DELETE/DDL). Multi-line input is supported.INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.com')

Outputs

FieldTypeDescriptionExample
textSTRINGHuman-readable summary of the execution result (e.g., success message or error details).Executed successfully. Rows affected: 1
jsonSTRINGStructured JSON result for programmatic handling (status, rows affected, errors).{"status": "success", "rows_affected": 1}
htmlSTRINGOptional HTML representation of the result. Typically empty for execute operations.
Execution Result: Rows affected: 1
xlsxBYTESOptional Excel data. Usually empty for execute operations.
pdfBYTESOptional PDF data. Usually empty for execute operations.

Important Notes

  • Credentials template: Uses the "mssql" credential template; ensure your stored credentials conform to it.
  • Operation scope: Intended for non-SELECT operations. Use a dedicated query node for SELECT statements.
  • One statement recommended: Provide a single executable statement. Chain nodes for multi-step operations.
  • Timeout management: Increase timeout for long-running operations to prevent premature failure.
  • Security: Do not interpolate untrusted input into SQL to avoid injection vulnerabilities.
  • Permissions: Ensure the database user has necessary privileges for the operation.

Troubleshooting

  • SQL syntax errors: Validate the statement syntax and table/column names.
  • Permission denied: Verify the MSSQL credentials have required DML/DDL permissions.
  • Operation timed out: Increase the timeout or optimize the statement/database performance.
  • Invalid credentials_path: Confirm the path/reference is correct and accessible.
  • Connectivity issues: Check host, port, network/firewall rules, and server availability.
  • No rows affected: Review WHERE clauses and data conditions to ensure target rows match.