In SQL Server 2005 (not 7.0), is there any reason to use NVARCHAR(255) instead of 256 or some other number?
Is there any optimal size, and is there any reason to use powers of two?
(I will be storing Unicode data, so I have to use NVARCHAR)
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.
In SQL Server (2000 and earlier IIRC), the optimal (possibly even maximum) size of columns is dependent on the size of all columns together, excluding (n)text and image contents. I believe 8K is the ‘natural’ size of records in a table, so your column size added together should be something less than 8000 bytes.
From SQL Server 2005 an higher this isn’t much of an issue, I believe.