What is the Difference Between VARCHAR and VARCHAR(MAX) Datatypes in SQL Server ?

VARCHAR stores variable-length character data whose range varies up to 8000 bytes; varchar(MAX) stores variable-length character data whose range may vary beyond 8000 bytes and till 2 GB. TEXT datatype and "Text in row" table option will be deprecated in future versions, and the usage of VARCHAR(MAX) is strongly recommended instead of TEXT datatypes.

VARCHAR(MAX) Datatypes can be used inside triggers and unlike Text, datatype can be used with normal string functions (LEN, Substring, Concatenation, as Local variables etc).



You May Interest

Making a Backup of MS SQL Database With Query

MS SQL Finding Which Tables a Column Name is In

What is TABLESAMPLE in SQL Server ?

What are Wait Types in SQL Server ?

What is an OUTPUT Clause Inside SQL Server ?