views:

55

answers:

2

What are the storage requirements for nvarchar(X)?

So for example, if the value in a column is much smaller than X, how much is actually stored in the database page?

+3  A: 

An nvarchar column is the size of the number of unicode characters stored inside + an overhead. The exact size is probably dependant of the SQL server in use.

For Microsoft SQL server "the storage size, in bytes, is two times the number of characters entered + 2 bytes". See: http://msdn.microsoft.com/en-us/library/ms186939.aspx

VVS
+3  A: 

According to Microsoft:

"Storage size, in bytes, is two times the number of characters entered."

In actuality, there is an extra 2-bytes used beyond that as overhead to show length.

Tom H.