Difference in “varchar” and “nvarchar” in SQL Server

This article explains the difference between varchar and nvarchar datatype in SQL Server.

nVarchar Varchar
varchar stores UNICODE data.  Means it store UNICODE or multilingual data. Varchar Stores ASCII data
UNICODE requires 2 bytes for each character you store. This Means single row of a single nvarchar column can only be nvarchar (4000) Because because of the row size limitations of Sql Server is the same as the page size limit, which is 8060 bytes ASCII only requires 1 byte for each character.
This means a single row of a single varchar column can be varchar(8000) because of the row size limitations of Sql Server is the same as the page size limit, which is 8060 bytes

Posted

in

by

Tags:


Related Posts

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading