The SQL Server has the data type varchar and nvarchar . What is the main difference between the both ? Let’s explore it in this article.
What is the Difference between varchar and nvarchar in SQL Server?
varchar is a variable length and non-unicode data type which can take the 8-bit codepage. The collation of the database identifies which of the code page should be used in storing the data.
In contrast , nvarchar is also a variable length datatype which can take unicode character data which means you can store a unicode text / foriegn language text in this column .
One more difference is that the varchar(max) can hold upto 2^31 bytes of data where as nvarchar(max) can hold upto 2^30 bytes of data.
Leave a Reply