Skip to content

SQL Server Connection String

Builds a Microsoft SQL Server connection URI from individual parameters. Supports both SQL authentication and Windows Integrated Security, and optionally includes a named instance. Returns the constructed connection string as the primary output.
Preview

Usage

Use this node when you need to assemble a properly formatted SQL Server connection string from user-provided fields to pass into downstream database nodes or external tools. Typical workflow: provide host, port, database, and either username/password or enable integrated security; the node outputs a single ready-to-use connection URI.

Inputs

FieldRequiredTypeDescriptionExample
hostTrueSTRINGDatabase hostname or IP address.db.mycompany.internal
portTrueINTTCP port for SQL Server. Default is 1433.1433
databaseTrueSTRINGTarget database name.SalesDB
usernameTrueSTRINGSQL Server login username. Ignored if Integrated Security is enabled.sa
passwordTruePASSWORDSQL Server login password. Ignored if Integrated Security is enabled.
instanceFalseSTRINGNamed SQL Server instance. If provided, it is added to the connection string.MSSQLSERVER
integrated_securityTrueBOOLEANUse Windows Integrated Security (true) instead of username/password (false).False

Outputs

FieldTypeDescriptionExample
connection_stringSTRINGThe constructed MSSQL connection URI. Uses Integrated Security or username/password based on inputs.mssql://username:@db.mycompany.internal:1433/SalesDB
jsonSTRINGJSON-formatted error details when construction fails; empty on success.{"error": "Failed to construct connection string: "}
out_3STRINGUnused placeholder output (empty string).
out_4STRINGUnused placeholder output (empty string).
out_5STRINGUnused placeholder output (empty string).

Important Notes

  • If integrated_security is true, username and password are ignored and the connection string includes integrated_security=true.
  • When an instance is provided, it is appended as a query parameter (instance=).
  • Special characters in usernames or passwords may need URL encoding to ensure a valid URI.
  • Only the first output (connection_string) is meaningful on success; other outputs are placeholders.
  • On error, the first output contains a human-readable message and the second output contains a JSON-formatted error string.

Troubleshooting

  • Connection string is missing parts: Verify host, port, and database are provided and non-empty.
  • Authentication issues downstream: If using Integrated Security, ensure the environment supports it; otherwise set integrated_security to false and provide username/password.
  • Invalid characters in password: URL-encode special characters in the password before input.
  • Incorrect server/instance resolution: If connecting to a named instance, provide the instance value; otherwise leave it blank and ensure the port is correct.
  • Error returned in second output: Inspect the JSON error string for details and correct the offending parameter.