First create a data table
CREATE TABLE [dbo]. [Log_info] ([id] [int] IDENTITY (1,1) not NULL, [INFO] [varchar] () NULL, [ INFO1] [varbinary] () NULL, [Imagecol] [image] NULL, [Binarycol] [binary] (ten) NULL)
To insert binary data into a table:
INSERT INTO [log_info] default valuesupdate [Log_info] Set = CONVERT (varbinary),'aaaaa'= CONVERT (varbinary (50 ),'aaaaa')Select from [Log_info]
Will find the displayed hexadecimal data
As we can see in the Edit Data window, binary data is actually stored
This discrepancy, my understanding is that the computer for binary data operation is the best, so storage is preferred binary.
However, at the time of presentation, the 4-bit binary number can represent 1-bit hexadecimal digits, which is more concise and intuitive on the representation.
Above is my understanding, welcome everybody to discuss together.
Ps:text/image is placed on the LOB page, varchar (max), nvarchar (max), varbinary (max) stored in the Row-overflow (row overflow) page.
Discussion post: SQL Server varbinary is binary data, but it is a hexadecimal representation