Help! Buffer array, SQL insert help

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!!!

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...

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