|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Binary and Large-Value Data (ADO.NET)
Microsoft SQL Server 2005 introduced the max specifier, which expands the storage capacity of the varchar, nvarchar, and varbinary data types. varchar(max), nvarchar(max), and varbinary(max) are collectively called large-value data types. You can use the large-value data types to store up to 2^31-1 bytes of data. The text, ntext, and image data types in earlier versions of SQL Server can be replaced with varchar(max) and nvarchar(max), respectively, and the image data type can be replaced with varbinary(max).
When using the max modifier, the maximum in-row storage for large value data types is set to 8,000 bytes. When a large value type or a large object data type column value is stored in the data row, the Database Engine does not have to access a separate page or set of pages to read or write the character or binary string.
SQL Server 2008 introduces the FILESTREAM attribute, which is not a data type, but rather an attribute that can be defined on a column, allowing large-value data to be stored on the file system instead of in the database. FILESTREAM data benefits from the fast streaming capabilities and storage capabilities of the NTFS file system while being managed and accessed directly in the context of the database.