Hi All, I'm kind of new to this, so I'm struggling with a MSSQL Node Catch. My node red server has an unreliable connection to my SQL server that I am querying, so it often throws a connection error. If I try again, it usually works. So I want a Catch node to trigger a retry after a 5 second delay, but it seems that the SQL node doesn't throw a general error that is easily caught when the connection is down. Any tips?
Use the newer node-red-contrib-mssql-plus
It has many additional features including "throw error" option.
Ps you will need to remove the other mssql node otherwise they will conflict.
I moved all of my old flows out of the way to install the new sql node, and then put them back in place and couldn't figure out how to resolve these errors. So I reverted. Any ideas what to check?
"TypeError: sql.ConnectionPool is not a constructor" ALSO: object message: "Cannot read property 'execSql' of null" details: "Cannot read property 'execSql' of null" name: "TypeError" toString: function```
not seen that before.
What version of NODE JS and NODE-RED are you on?
How did you remove old SQL node? NPM or pallet?
Did you restart node-red after removal?
This is the steps I would personally take ...
- Export flows as backup just in case
- Stop node-red
- in terminal or cmd, cd to
npm uninstall node-red-contrib-mssql
npm install node-red-contrib-mssql-plus
- start node red
All should just work (might have to open the mssql nodes, check configs and click ok / deploy but thats about it.