Discussion post: SQL Server varbinary is binary data, but it is a hexadecimal representation

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.