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

MS SQL Get Current Time GETDATE()

What is SQL Server Agent ?

Making a MS SQL Offline Database Online

Using Trim Function in MS SQL

Where are SQL Server Usernames and Passwords Stored in the SQL Se ...