I have PDF documents stored in my table as binary, the column that stores the bytes for the PDFs is type varbinary(max)
. I want to update
one record with an updated document in SQL Studio, the way I am attempting to accomplish this is like below
UPDATE table
SET file_bytes=CONVERT(varbinary(max),'JVBERi0xLjYNCiW2JqDQo8PC9UeX...0YNCg==') --this is a base64 string
WHERE id='73c75254-ad86-466e-a881-969e2c6e7a04';
The query runs, but when I try to download the document (via the website), it throws an error message that reads PDF header signature not found.
Is this conversion even possible?