Hi
When u use Varchar(max), it is 8000 chars for a variable, and around 2^32 for a column, what is COLLATE and how it affects that?
Thanks
Hi
When u use Varchar(max), it is 8000 chars for a variable, and around 2^32 for a column, what is COLLATE and how it affects that?
Thanks
Collation deterines how SQL Server sorts and compares string data (which varchar
variables and column values are).
See here
When you declare a column or a variable of varchar(max)
, it can take up to 2 GB of data and 2^31-1 characters. If you declare the column or variable as nvarchar
, it can still only take 2 GB of data and (2^31-1) / 2 characters since each character takes up twice as much space. When you declare a varchar
column or variable without the use of the COLLATE
clause, the collation of the database is used. The ``COLLATE clause does not affect the capacity of the column or variable.