Difference between varchar and nvarchar are as follows:
VARCHAR
NVARCHAR
Varchar stores ASCII values.
Nvarchar stores Unicode characters.
Varchar uses one byte per character.
Nvarchar uses two bytes per character.
Varchar can store a maximum of 8000 non-Unicode characters.
Nvarchar stores maximum of 4000 Unicode or non-Unicode characters.
The storage capacity of a varchar is determined by the number of characters it contains, with an additional two bytes reserved for offset.
The storage capacity of nvarchar is calculated based on twice the number of characters it has, along with an extra two bytes that are set aside for offset.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Difference between varchar and nvarchar are as follows: