sql-serversql-server-2008sql-server-2005

What is the maximum characters for the NVARCHAR(MAX)?


I have declared a column of type NVARCHAR(MAX) in SQL Server 2008, what would be its exact maximum characters having the MAX as the length?


Solution

  • The max size for a column of type NVARCHAR(MAX) is 2 GByte of storage.

    Since NVARCHAR uses 2 bytes per character, that's approx. 1 billion characters.

    Leo Tolstoj's War and Peace is a 1'440 page book, containing about 600'000 words - so that might be 6 million characters - well rounded up. So you could stick about 166 copies of the entire War and Peace book into each NVARCHAR(MAX) column.

    Is that enough space for your needs? :-)