nvarchar(max)(To Be Or Not To Be)
-
when i should use nvarchar(max) type and when not?
-
when i should use nvarchar(max) type and when not?
-
when i should use nvarchar(max) type and when not?
An nvarchar column can stores unicode data but requires twice the space compared to varchar. A varchar column is restricted to an 8-bit codepage and is therefore limited to one or a few alphabets/languages at a time. Codepage incompatabilities are a PITA, and Unicode is the cure for codepage problems. Normally you take a performance hit using nvarchar as it takes twice the space in both memory and disc. But if the client uses a different codepage than the server you might take a performance hit on the conversion of the varchar instead.
"When did ignorance become a point of view" - Dilbert
-
when i should use nvarchar(max) type and when not?
Use it for strings; not for numerical and temporal data. :-D
-
when i should use nvarchar(max) type and when not?
I don't really understand your question. Are you asking:
- when should I use nvarchar instead of varchar?
- when should I use nvarchar(max) instead of a specified size such as nvarchar(100)?
- when should I use nvarchar(max) instead of ntext?
- when should I use nvarchar(max) instead another datatype?
- something else
- all of the above
These are all different questions (some of which have been answered already).