# Pass msq payload to SQL query where clause

**URL:** <https://discourse.nodered.org/t/pass-msq-payload-to-sql-query-where-clause/60231>\
**Category:** General\
**Created:** [23 March 2022 10:26 UTC](https://discourse.nodered.org/t/pass-msq-payload-to-sql-query-where-clause/60231 "2022-03-23T10:26:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [23 March 2022 10:35 UTC](https://discourse.nodered.org/t/pass-msq-payload-to-sql-query-where-clause/60231/2 "2022-03-23T10:35:10Z")

</div>

> [@QGIO](#):
>
> Which is the correct syntax

The "better" way is to use "Parameters"

> [@Node-red-contrib-mssql-plus =\> value in database is empty](https://discourse.nodered.org/t/node-red-contrib-mssql-plus-value-in-database-is-empty/52205/4):
>
> Hi, so a couple of things first. Please post code between backticks ``` like this ``` When copying values from the debug sidebar, use the "Copy Value" button that appears under your mouse cursor when you hover over the message [BX00Cy7yHi] On you your issue... The debug BEFORE SQL shows payload is an array but in your SQL, you try to access payload.ts\_pos\_wo\_id - an array is accessed by [] square brackets. To simplify things (and avoid mistakes) use the "Copy Path" button that ap…

---

_[View the full topic](https://discourse.nodered.org/t/pass-msq-payload-to-sql-query-where-clause/60231)._
