Registry /
database / node-red-contrib-mssql-plus
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MSSQL node (Node-RED)
✓ Drag 'MSSQL' node from palette or import flow JSON with type: 'MSSQL'
✗ Using 'node-red-contrib-mssql-plus' as a regular npm module (it is a Node-RED plugin, not a JS library).
This package provides Node-RED nodes, not programmable exports. Use within Node-RED flows.
Configuration node (MSSQL config)
✓ Add a 'MSSQL' config node (type: 'MSSQL config') with server, database, auth details.
✗ Directly hardcoding credentials in flow nodes without using config node.
Config nodes can use environment variables via triple-moustache syntax, e.g., {{{SQL_IP}}}.
Query parameters
✓ Define parameters in the node's 'Parameters' table or via msg.params.
✗ Using string interpolation inside SQL (risks SQL injection). Use @paramName placeholders.
Parameters can come from msg, flow, or global context, as well as static values.
Creates a Node-RED inject node that triggers a SELECT query on a MSSQL config node, outputting to debug.
// Example Node-RED flow JSON for a simple query inject -> MSSQL -> debug
[{"id":"1","type":"inject","name":"trigger","payload":"","repeat":"","once":false,"x":100,"y":100,"wires":[["2"]]},{"id":"2","type":"MSSQL","name":"query","mssqlCN":"3","outField":"payload","returnType":"1","throwErrors":"0","query":"SELECT GETDATE() AS now","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"editor","params":[],"x":300,"y":100,"wires":[["4"]]},{"id":"3","type":"MSSQL config","name":"myserver","server":"{{{$SQL_SERVER}}}","port":"1433","encrypt":"true","trustServerCertificate":"false","authentication":"azure-active-directory-password","username":"{{{$SQL_USER}}}","password":"{{{$SQL_PASS}}}","database":"{{{$SQL_DB}}}","domain":"","domainUserName":"","domainPassword":"","connectionTimeout":"15","requestTimeout":"15","sslCert":"","sslHost":"","sslCa":"","options":""},{"id":"4","type":"debug","name":"output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":500,"y":100,"wires":[]}]
Errors
Common errors & fixes
Error: Failed to connect to server: ...
Connection configuration incorrect or server unreachable (network/firewall).
fixVerify server address, port, credentials, and network access. Check if TLS encryption is required.
ReferenceError: {{{sql_ip}}} is not defined
Environment variable not set or triple moustache syntax wrong.
fixDefine all used env vars in Node-RED environment or provide default values. Use correct syntax: {{{ENV_VAR}}}. TypeError: msg.payload is not iterable
Bulk insert expects an array of objects but received something else.
fixEnsure msg.payload is an array of objects (rows) before bulk insert node.
The server did not respond in a timely fashion
Connection or request timeout reached.
fixIncrease 'connectionTimeout' and 'requestTimeout' in config node, or optimize query performance.
Audit
Dependencies
node-redrequiredThis is a Node-RED node; it only runs inside a Node-RED instance.
mssqlrequiredCore database driver for SQL Server connections.
tediousoptionalTDS protocol implementation used by mssql; may be included as a dependency of mssql.