Hi, all
I'm trying to insert content of .pdf into varbinary(max) column.
I don't have option to use any .net cool tools, just have SSMS on 2008.
I tried to use something like:
insert into t1(xdata) values ('0x1234')
and get this error:
Msg 257, Level 16, State 3, Line 1
Implicit conversion from data type varchar(max) to varbinary(max) is not allowed. Use the CONVERT function to run this query.
So looks like I can't use single ' around binary value, and '0x12343122' is actual binary value , when I use cast('0x1234' as varbinary(max)) it convert it into another value of course, thinking it's varchar.
Can anybody recommend the way to achieve this. I'm not sure can I reference a physical file in INSERT? and then do convert.
Thanks all for your help.
Dai