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

Using MS SQL TOP

Using Trim Function in MS SQL

What is an OUTPUT Clause Inside SQL Server ?

Benefits of Using Stored Procedures in MS SQL

Using MS SQL COUNT