# Insert data to Microsoft Azure

**URL:** <https://discourse.nodered.org/t/insert-data-to-microsoft-azure/12806>\
**Category:** General\
**Created:** [2 July 2019 07:43 UTC](https://discourse.nodered.org/t/insert-data-to-microsoft-azure/12806 "2019-07-02T07:43:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_tien](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jason\_tien](https://discourse.nodered.org/u/jason_tien)\
**Post date:** [2 July 2019 07:43 UTC](https://discourse.nodered.org/t/insert-data-to-microsoft-azure/12806/1 "2019-07-02T07:43:10Z")

</div>

Hi everyone. I would like to ask about why the Microsoft Azure every time just **get one to two data** only? how to solve this problems? Because my flow is when the groov view detected "1" or "0" I need to store the data in database.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8633647f2414b1334f138ca8316ef587fed80355.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0ecb209d9195fd2efb41b1393c14d659806b669d.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b25d4ca78d184fe73630b78408663f39977113c8.png)  
and I tried to change my flow to the following pic also cannot. They just send 2 data to Microsoft Azure SQL Database.(actually I want to send all the data)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e3202add4a0f5b80edabd49a72f35ae2869a13a4.png)

TQVM.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [2 July 2019 08:05 UTC](https://discourse.nodered.org/t/insert-data-to-microsoft-azure/12806/2 "2019-07-02T08:05:36Z")

</div>

Generally a node in node read has no idea how many wires / messages are being sent to it.

You will need to join all those messages together before you send the message to the database node.

Take a look at the `join` node.

---

<div class="post-metadata">

**Author:** ![jason\_tien](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jason\_tien](https://discourse.nodered.org/u/jason_tien)\
**Post date:** [2 July 2019 08:31 UTC](https://discourse.nodered.org/t/insert-data-to-microsoft-azure/12806/3 "2019-07-02T08:31:38Z")

</div>

Hi @ukmoose. Sorry for a noob questions. My flow like this how to using join node?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9089b4f5390abbe577b24cb08c537a25c8194343.png)  
I retrieve the 1 and 0 from the groov view then I wrote some function (specific the name)and store in database.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/ab395ebcea881118d8d822b5b98d6146ade860e0.png)

Previous I using MSSQL dont have problems.

TQVM.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [2 July 2019 08:56 UTC](https://discourse.nodered.org/t/insert-data-to-microsoft-azure/12806/4 "2019-07-02T08:56:37Z")

</div>

Currently you are sending 13 different messages milliseconds apart, to Azure SQL.

It would be better to send one command that posts all 13 bits of data into the database. To do that you need to join all the separate bits of data back together.

So for example you make the ac\_pwr line put the data in to msg.ac\_pwr etc etc

Then use the join node to join all the messages back up together, and then create your one database insert query.

```auto
[{"id":"87c48bfa.9ab17","type":"inject","z":"9fb9c7f0.5e3fb","name":"","topic":"","payload":"a","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":77,"y":256,"wires":[["e01e19e1.98da08","83402a83.7ea158"]]},{"id":"e01e19e1.98da08","type":"function","z":"9fb9c7f0.5e3fb","name":"ac_pwr","func":"msg.topic = \"ac_pwr\"\nmsg.payload = \"1\"\nreturn msg;","outputs":1,"noerr":0,"x":268,"y":183,"wires":[["5ba00b36.557f94","27624865.517168"]]},{"id":"83402a83.7ea158","type":"function","z":"9fb9c7f0.5e3fb","name":"alert_lvl","func":"msg.topic =\"alert_lvl\"\nmsg.payload = \"0\"\nreturn msg;","outputs":1,"noerr":0,"x":266,"y":280,"wires":[["5ba00b36.557f94","6ef4b3b5.c92fac"]]},{"id":"5ba00b36.557f94","type":"join","z":"9fb9c7f0.5e3fb","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":441,"y":242,"wires":[["1544d023.04522"]]},{"id":"1544d023.04522","type":"debug","z":"9fb9c7f0.5e3fb","name":"JOIN","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":603,"y":234,"wires":[]},{"id":"27624865.517168","type":"debug","z":"9fb9c7f0.5e3fb","name":"ac_pwr","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":407,"y":108,"wires":[]},{"id":"6ef4b3b5.c92fac","type":"debug","z":"9fb9c7f0.5e3fb","name":"alert_lvl","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":443,"y":455,"wires":[]}]

```
