Insert hex string value to sql server binary field is appending extra 0
- by rotary_engine
Have a binary field and want to insert into this from a hex string:
insert into binaryTable(binaryField)
values(convert(varbinary(max), 0x0))
however when I run select the value is return with an extra 0 as 0x00
This extra 0 is causing a problem in another application, I dont want it.
Interesting, is if I do a select on an existing value and it returns say 0x55 then inserting this same value using the above query will return a select of 0x055.
How to stop the extra 0 being added?