The correct way to insert a varbinary value into MSSQL table

SQL server

Assume we have the binary data encoded as a hex string starting with '0x'

Then we need to use this code:

INSERT INTO Cards ([binaryColumn]) VALUES (CONVERT(VARBINARY, '0x4600009EF4652A774600009EF4652A77', 1))

Post a Comment

Previous Post Next Post