# Catch MSSQL node error

**URL:** <https://discourse.nodered.org/t/catch-mssql-node-error/23675>\
**Category:** General\
**Created:** [26 March 2020 14:33 UTC](https://discourse.nodered.org/t/catch-mssql-node-error/23675 "2020-03-26T14:33:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![coasterguru](https://avatars.discourse-cdn.com/v4/letter/c/9e8a1a/32.png) [@coasterguru](https://discourse.nodered.org/u/coasterguru)\
**Post date:** [26 March 2020 14:33 UTC](https://discourse.nodered.org/t/catch-mssql-node-error/23675/1 "2020-03-26T14:33:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 March 2020 14:35 UTC](https://discourse.nodered.org/t/catch-mssql-node-error/23675/2 "2020-03-26T14:35:11Z")

</div>

Use the newer node-red-contrib-mssql-plus

It has many additional features including "throw error" option.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 March 2020 14:35 UTC](https://discourse.nodered.org/t/catch-mssql-node-error/23675/3 "2020-03-26T14:35:48Z")

</div>

Ps you will need to remove the other mssql node otherwise they will conflict.

---

<div class="post-metadata">

**Author:** ![coasterguru](https://avatars.discourse-cdn.com/v4/letter/c/9e8a1a/32.png) [@coasterguru](https://discourse.nodered.org/u/coasterguru)\
**Post date:** [26 March 2020 19:01 UTC](https://discourse.nodered.org/t/catch-mssql-node-error/23675/4 "2020-03-26T19:01:53Z")

</div>

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?

````auto

"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```
````

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 March 2020 19:49 UTC](https://discourse.nodered.org/t/catch-mssql-node-error/23675/5 "2020-03-26T19:49:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 May 2020 19:49 UTC](https://discourse.nodered.org/t/catch-mssql-node-error/23675/6 "2020-05-25T19:49:05Z")

</div>

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