Difference between VARCHAR and NVARCHAR are following:
Data Store : A VARCHAR column is
restricted to an 8-bit codepage while An NVARCHAR column can store any Unicode
Performance : A VARCHAR column is slow to
read or write to the database while A NVARCHAR is fast because all modern
operating systems and development platforms use Unicode internally. By using NVARCHAR
rather than VARCHAR, you can avoid doing encoding conversions every time you
read from or write to the database. Conversions take time, and are prone to
errors. And recovery from conversion errors is a non-trivial problem.
Size : VARCHAR can hold up to 2^31
bytes of data, or 2,147,483,648 characters; NVARCHAR(MAX) can hold 2^30 bytes,
or 1,073,741,823 characters.
Memory : NVARCHAR take twice space compare
Use: NVARCHAR uses for multi-lingual
site. So always use NVARCHAR rather than VARCHAR.
1. Create a Table
CREATE TABLE CountryInfo
2. Insert a Row
3. Show Table Data
SELECT Name,StateName FROM CountryInfo