SQL Server char nchar nvarchar varchar

Source: Internet
Author: User

Char stores a fixed-length string with a maximum length of 8,000 bytes.

varchar stores a variable-length string with a maximum length of 8,000 bytes.

NCHAR stores a fixed-length Unicode string with a maximum length of 4,000 characters.

Nvarchar stores a variable-sung Unicode string with a maximum length of 4000 value characters.


Note that the following are:

The allocation of storage space will be different, such as varchar (10) allocated 10 bytes nvarchar (10) can be allocated 20 bytes. That is to say nvarchar (10) or varchar (10) stores more information. Because one is a byte store, one is a character.

SQL Server char nchar nvarchar varchar

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.