# How to store all contents of an Intel hex file it on sql server database?

**URL:** <https://discourse.nodered.org/t/how-to-store-all-contents-of-an-intel-hex-file-it-on-sql-server-database/67248>\
**Category:** General\
**Created:** [2 September 2022 08:45 UTC](https://discourse.nodered.org/t/how-to-store-all-contents-of-an-intel-hex-file-it-on-sql-server-database/67248 "2022-09-02T08:45:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discourse.nodered.org/u/Nirajan)\
**Post date:** [2 September 2022 08:45 UTC](https://discourse.nodered.org/t/how-to-store-all-contents-of-an-intel-hex-file-it-on-sql-server-database/67248/1 "2022-09-02T08:45:32Z")

</div>

Hi Everyone,

I am reading an Intel hex file of size more than 60KB, using an 'file in' node, which gives output as 'a single Buffer object'.

I have a table with a field of data type varbinary(max) in ms sql server. I am storing the buffer output from 'file in' node directly onto the database using 'node-red-contrib-mssql-plus' node'. Do i need to change the buffer data output from 'file in' to some other data types before storing onto the database or should i use different data type for the table field?

I am getting "The floating point value '1051e40002440346934200' is out of the range of computer representation (8 bytes)." from the database. Please kindly help me to find the mistakes and clear my misunderstandings.

Any help would be really grateful. Thanks

Best Regards,

---

<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:** [2 September 2022 08:48 UTC](https://discourse.nodered.org/t/how-to-store-all-contents-of-an-intel-hex-file-it-on-sql-server-database/67248/2 "2022-09-02T08:48:17Z")

</div>

Can you share your flow please? Also, a screenshot of the MSSQL-PLUS nodes edit dialog.

---

<div class="post-metadata">

**Author:** ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discourse.nodered.org/u/Nirajan)\
**Post date:** [2 September 2022 09:19 UTC](https://discourse.nodered.org/t/how-to-store-all-contents-of-an-intel-hex-file-it-on-sql-server-database/67248/3 "2022-09-02T09:19:37Z")

</div>

Hi Steve,

Thanks for your reply.  
Here the screenshots of the flow, function node and MSSQL-PLUS nodes:

 ![save_hex_file_DB](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/3/43b112b9c66ca53ddb717e57385ac38e4d7ebf50.png)

![hex_file_function_node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/13fbe3f0aba11726302c1a3494d806749bbb3e7a.png)

 ![edit-mssqlnode](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/588e3afc81b09eefe0bd136fc9fe83bfcc33bf52.png)

Best Regards,

---

<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:** [2 September 2022 10:21 UTC](https://discourse.nodered.org/t/how-to-store-all-contents-of-an-intel-hex-file-it-on-sql-server-database/67248/4 "2022-09-02T10:21:49Z")

</div>

~~duplicate post~~

---

<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:** [2 September 2022 10:22 UTC](https://discourse.nodered.org/t/how-to-store-all-contents-of-an-intel-hex-file-it-on-sql-server-database/67248/5 "2022-09-02T10:22:12Z")

</div>

As a test, could you set the `VarBinary` size in the Parameter to match your DB? (e.g. `VarBinary(8000)`)

Also, could you add a debug (set to Show Complete Message) after the "Prepare insert query parameters" function & show me a screenshot of the `msg` and its properties that are going into the MSSQL-PLUS node?

---

<div class="post-metadata">

**Author:** ![Nirajan](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@Nirajan](https://discourse.nodered.org/u/Nirajan)\
**Post date:** [2 September 2022 12:06 UTC](https://discourse.nodered.org/t/how-to-store-all-contents-of-an-intel-hex-file-it-on-sql-server-database/67248/6 "2022-09-02T12:06:20Z")

</div>

Hi Steve,

I removed the field from the database table and created a new field with its data type set to varbinary(8000), like you said. Also i have set the query parameter's data type to varbinary(8000) in MSSQL-PLUS node.

And now it works fine :).  
I am still not sure what the problem was but now it is working.

Once again, thank you very much for your help Steve.

Best Regards,  
Nirajan

---

<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:** [1 November 2022 12:06 UTC](https://discourse.nodered.org/t/how-to-store-all-contents-of-an-intel-hex-file-it-on-sql-server-database/67248/7 "2022-11-01T12:06:20Z")

</div>

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