# Help! Buffer array, SQL insert help

**URL:** https://discourse.nodered.org/t/help-buffer-array-sql-insert-help/11737
**Category:** General
**Created:** [31 May 2019 23:05 UTC](https://discourse.nodered.org/t/help-buffer-array-sql-insert-help/11737 "2019-05-31T23:05:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![haroon-rehman](https://avatars.discourse-cdn.com/v4/letter/h/4af34b/32.png) [@haroon-rehman](https://discourse.nodered.org/u/haroon-rehman)
#### Post date: [31 May 2019 23:05 UTC](https://discourse.nodered.org/t/help-buffer-array-sql-insert-help/11737/1 "2019-05-31T23:05:36Z")

</div>

Help!!! Stuck on this for past 1 day!

Hi I'm trying to save a buffer array to SQL

msg.payload : buffer[211584]  
[37, 80, 68, 70 ...]

I'm using the MSSQL node to insert this data in a table in the varbinary(max) column.

INSERT INTO [DocumentLibrary] VALUES(1, {{payload}})

But I'm getting the error message RequestError: '�C�؟�� ��@���ֲ^��9J�ͦ��B��a.X#�h� d��RAKj����n7щ󬮨\F�tV;N/�)|.W��Ƅ��$���$' is an invalid name because it contains a NULL character or an invalid Unicode character.

I think it the way I'm using the insert query, any help is highly appreciated!!!

---

<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: [1 June 2019 05:43 UTC](https://discourse.nodered.org/t/help-buffer-array-sql-insert-help/11737/2 "2019-06-01T05:43:28Z")

</div>

The payload is getting converted to string by the template. Add to that your template string has no quotes to contain the resulting string.

Perhaps try something like...

```auto
INSERT INTO [DocumentLibrary] VALUES(1, convert(varbinary, '{{payload}}')

```
