The varchar (max), nvarchar (max), and varbinary (max) Data Types in SQL Server

Source: Internet
Author: User
The varchar (max), nvarchar (max), and varbinary (max) data types are added to SQL Server 2005. Shard data type (large-value data types) , Marked with the Max specifier. The varchar (max), nvarchar (max), and varbinary (max) data types correspond to SQL Server 2000 and earlier versions of varchar, nvarchar, and varbinary respectively. The Bytes data type can store data up to 2 ^ 31-1 bytes. Therefore, when using the varchar, nvarchar, and varbinary data types, you can use the corresponding shard data type. In the past, database operations often encountered the "sqlexception: truncates string or binary data errors" error, causing this exception to have a great relationship with the length or accuracy of the data type, now we can avoid these problems to some extent if we use the volume data type.

Correspondence:

Varchar (max) Text *[2 ^ 30-1 (1,073,741,823) characters]
Nvarchar (max) Ntext *[2 ^ 31-1 (2,147,483,647) characters/bytes]
Varbinary (max) Image [2 ^ 31-1 (2,147,483,647) bytes]
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.