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

What are Isolation Levels in SQL Server ?

What are the Limitations of Indexed Views in SQL Server ?

Showing Server Active Server Name in MS SQL

What are Sparse Columns in SQL Server ?

What are Some Advantages of Using CTE in SQL Server ?