# Store data arduino to SQL SERVER

**URL:** <https://discourse.nodered.org/t/store-data-arduino-to-sql-server/13149>\
**Category:** General\
**Created:** [11 July 2019 06:06 UTC](https://discourse.nodered.org/t/store-data-arduino-to-sql-server/13149 "2019-07-11T06:06:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arul-B](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/arul-b/32/10084_2.png) [@Arul-B](https://discourse.nodered.org/u/Arul-B)\
**Post date:** [11 July 2019 06:06 UTC](https://discourse.nodered.org/t/store-data-arduino-to-sql-server/13149/1 "2019-07-11T06:06:21Z")

</div>

How to store data sensor from arduino to sql server ?,

Thank you

---

<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:** [11 July 2019 06:21 UTC](https://discourse.nodered.org/t/store-data-arduino-to-sql-server/13149/2 "2019-07-11T06:21:18Z")

</div>

Have you looked at [flows.nodered.org](http://flows.nodered.org) for flows that might get you started?

Break your problem down into little steps and tackle the first one getting the data into node-RED

---

<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:** [11 July 2019 07:05 UTC](https://discourse.nodered.org/t/store-data-arduino-to-sql-server/13149/3 "2019-07-11T07:05:08Z")

</div>

There are many posts about getting data to Node-red via MQTT - start there.

Once you have that working, look into adding `node-red-contrib-mssql-plus` via the pallete.

If you get stuck, search here & if necessary, ask a question, showing your progress & screen shots.

---

<div class="post-metadata">

**Author:** ![baqwas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/baqwas/32/106_2.png) [@baqwas](https://discourse.nodered.org/u/baqwas)\
**Post date:** [11 July 2019 20:19 UTC](https://discourse.nodered.org/t/store-data-arduino-to-sql-server/13149/4 "2019-07-11T20:19:24Z")

</div>

My two bits ( **if** your Arduino is anchored to a desktop); use the following two nodes:

- Use the Arduino Serial library functions to format the payload and read it using the **serial** node
- Use the **sql** node to insert into database

If your Arduino has Wi-Fi (e.g. MKR series or the newer Wi-Fi 2 shield) then you can use the MQTT library as others have suggested (give some thought to the broker depending on computing resources at your disposal) to _pub_ the data and then use MQTT node to _sub_ the data for use in your flows (including db INSERTs) as you wish. There are extensive examples on crafting the [[[payload]]] for inserting multiple VALUES in a single INSERT statement (if applicable for your use case - sensor emanating multiple streams of data). Once you receive the data from the Arduino at the head of a flow (even before the INSERT operation), the options are truly very extensive and "rich" given so many nodes and so little time.

Kind regards.

---

<div class="post-metadata">

**Author:** ![Arul-B](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/arul-b/32/10084_2.png) [@Arul-B](https://discourse.nodered.org/u/Arul-B)\
**Post date:** [12 July 2019 00:01 UTC](https://discourse.nodered.org/t/store-data-arduino-to-sql-server/13149/5 "2019-07-12T00:01:54Z")

</div>

Ok, thanks guys,
