Mssql connection close

i am trying to connect mssql my config { user: "username",
password: "password",
server: "10.0. . ",
port:1433,
database:"dbname",
options: {
encrypt: false
}}

this is my config
this mssql db has external connection, able to connect from node js script using mssql npm, i am using node-red-contrib-mssql-port

I am using this config in multiple flows, in first flow am able to connect and get data, in second flow if i try to connect keep getting this error Error: Global connection already exists. Call sql.close() first.

When you configured the server config did you make sure that On All Flows is selected at the bottom, and then use the same config on the other flow (not a new config)?

[Edit] I also notice that there are issues raised against the node, including one which might be related to your problem, and it appears the node has been abandoned. You might be better to find another mssql node.

alternatively rework your flows to only use the one sql node. You do this by adding an item to the message before the mssql node and then switching based on that after the node

1 Like