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] |