Catch MSSQL node error

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.

1 Like

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"


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 ...

  1. Export flows as backup just in case
  2. Stop node-red
  3. in terminal or cmd, cd to .node-red folder
  4. npm uninstall node-red-contrib-mssql
  5. npm install node-red-contrib-mssql-plus
  6. start node red

All should just work (might have to open the mssql nodes, check configs and click ok / deploy but thats about it.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.