# MSSQL node msg reading

**URL:** <https://discourse.nodered.org/t/mssql-node-msg-reading/63004>\
**Category:** General\
**Created:** [24 May 2022 11:48 UTC](https://discourse.nodered.org/t/mssql-node-msg-reading/63004 "2022-05-24T11:48:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![noob69](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@noob69](https://discourse.nodered.org/u/noob69)\
**Post date:** [24 May 2022 11:48 UTC](https://discourse.nodered.org/t/mssql-node-msg-reading/63004/1 "2022-05-24T11:48:49Z")

</div>

Hi,

I need to add a value to a table. So I've created MSSQL node and input my msg as following.

`INSERT INTO alert(email,alert,status,interval) VALUES('{{{msg.email}}}','time',1,10)`

But it output a blank instead of the value of `msg.email`. I have checked the output by intiating a debug node as msg.email. It gives the correct output.

What is causing this?

---

<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:** [24 May 2022 12:15 UTC](https://discourse.nodered.org/t/mssql-node-msg-reading/63004/2 "2022-05-24T12:15:34Z")

</div>

To avoid issues like quotes in the string or SQL injection, you should use parameters...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/c/ac94931dee23dfea9bac4007265a25f8348804a0.png)

Also, double check the msg going into the SQL node by setting the debug node to show complete message.

---

<div class="post-metadata">

**Author:** ![noob69](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@noob69](https://discourse.nodered.org/u/noob69)\
**Post date:** [24 May 2022 12:27 UTC](https://discourse.nodered.org/t/mssql-node-msg-reading/63004/3 "2022-05-24T12:27:28Z")

</div>

Thanks a lot, Nice explanation

---

<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:** [7 June 2022 12:28 UTC](https://discourse.nodered.org/t/mssql-node-msg-reading/63004/4 "2022-06-07T12:28:08Z")

</div>

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