I’m new to the concept nvarchar(MAX). How many characters will it hold?
I’m new to the concept nvarchar(MAX) . How many characters will it hold?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Max. capacity is 2 gigabytes of space – so you’re looking at just over 1 billion 2-byte characters that will fit into a
NVARCHAR(MAX)field.Using the other answer’s more detailed numbers, you should be able to store
in your
NVARCHAR(MAX)column (unfortunately, that last half character is wasted…)Update: as @MartinMulder pointed out: any variable length character column also has a 2 byte overhead for storing the actual length – so I needed to subtract two more bytes from the
2 ^ 31 - 1length I had previously stipulated – thus you can store 1 Unicode character less than I had claimed before.