# How to insert an array into mssql?

**URL:** <https://discourse.nodered.org/t/how-to-insert-an-array-into-mssql/14374>\
**Category:** General\
**Created:** [16 August 2019 06:39 UTC](https://discourse.nodered.org/t/how-to-insert-an-array-into-mssql/14374 "2019-08-16T06:39:08Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![BilalMustafa](https://avatars.discourse-cdn.com/v4/letter/b/c57346/32.png) [@BilalMustafa](https://discourse.nodered.org/u/BilalMustafa)\
**Post date:** [16 August 2019 09:28 UTC](https://discourse.nodered.org/t/how-to-insert-an-array-into-mssql/14374/21 "2019-08-16T09:28:21Z")

</div>

bro by using this way

SET @val1= '{{{msg.payload[0]}}}';  
SET @val2= '{{{msg.payload[1]}}}';

null data is adding into database.

---

<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:** [16 August 2019 09:31 UTC](https://discourse.nodered.org/t/how-to-insert-an-array-into-mssql/14374/22 "2019-08-16T09:31:04Z")

</div>

you need to put debug nodes before and after like i've said several times now

---

<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:** [16 August 2019 09:32 UTC](https://discourse.nodered.org/t/how-to-insert-an-array-into-mssql/14374/23 "2019-08-16T09:32:00Z")

</div>

also, it may be...

```auto
SET @val1= '{{{payload[0]}}}';
SET @val2= '{{{payload[1]}}}';

```

check the built in help on the MSSQL-PLUS node - it gives you examples.

---

<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:** [16 August 2019 09:33 UTC](https://discourse.nodered.org/t/how-to-insert-an-array-into-mssql/14374/24 "2019-08-16T09:33:38Z")

</div>

I have a feeling `msg` part is not required when accessing msg properties in `{{{mustache}}}`

Only needed for {{{flow.xxx}}} and {{{global.xxx}}}

[Previous page](https://discourse.nodered.org/t/how-to-insert-an-array-into-mssql/14374.md?page=1)
