September 8, 2011 at 2:32 pm
For the below table create script, the column length is specified as 255, for a nvarchar column, when
create table TestA
(
ID int,
IdDesnvarchar(255)
)
After table is created, lengths are
IDint no4
IdDesnvarchar no510
After the table is created, the lenght of the IdDes column is 510 instead of 255.
Intrestingly, any length specified in the column defintion, is doubled after table creation.
What seems to be happening. Any ideas.
September 8, 2011 at 2:36 pm
You're seeing the length in bytes. Each NVARCHAR character takes up two bytes of storage.
September 9, 2011 at 1:02 am
notoriousdba (9/8/2011)
You're seeing the length in bytes. Each NVARCHAR character takes up two bytes of storage.
In SQL Server, do you know of a language or collation setting that would cause any NVARCHAR character to use only 1 byte?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply