I am trying to save a file but because of that additional zero the file is not opening when downloaded from Database.
There are many questions around this but could not get an answer
Update varbinary(MAX) field in SQLServer 2012 Lost Last 4 bits
Can some one please help me in saving a file as a seed data while goes as a postscript in my DB project
Adding more info to repro issue.
CREATE TABLE [Thumbnail](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Data] [varbinary](max) NULL
CONSTRAINT [PK_Thumbnail] PRIMARY KEY CLUSTERED
(
[Id] ASC
) ) ON [PRIMARY]
INSERT [Thumbnail] ( Data )
SELECT * FROM OPENROWSET (BULK 'img.png', SINGLE_BLOB) AS X
if I upload an image with the above script it is working good(with odd length as well). But the same script is updated as a
insert into thumbnail (data) values(0x7364736466736466736) it is appending additional zero and I am not able to open my file back if the length is odd.
Please help.