Difference Between varchar and nvarchar datatype?

Answer Posted / p.pradeepa

Varchar2(s) is used to define a variable length character
of maximum size s.

Nvarchar2: Same as VARCHAR2 except that the column stores
values in the National CS ie you can store values in Bangla
if your National CS is BN8BSCII .If the National CS is of
fixed width CS (all characters are represented by a fixed
byte say 2 bytes for JA16EUCFIXED) then NVARCHAR2(30)
stores 30 Characters.

If the National CS is of variable width CS (some characters
are represented by 1 byte some by 2 bytes as in UTF8 ) then
NVARCHAR2(30) stores 30 bytes.
The maximum column size allowed is 4000 bytes.
Ex: CREATE TABLE tab1 (col1 NVARCHAR2(2000)); will create a
table with one NVARCHAR2 column of 2000 characters in
length (stored as 4000 bytes because each character takes
two bytes) using JA16EUCFIXED as the national character
set:

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of cursor type are there?

589


How can you find out which stored procedures are recompiling?

514


How to disable triggers using "disable trigger"?

556


What command is used to delete a table from the database in the sql server and how?

540


Explain trigger and its types?

612






How to verify a user name with sqlcmd tool?

583


What happens if null values are involved in boolean operations?

556


What are different types of statements that are supported by sql?

594


What is sql server profiler?

569


What causes index fragmentation?

576


Is it possible to import data directly from t-sql commands without using sql server integration services? If so, what are the commands?

855


Create and insert into temp table in sql server?

581


What are functions in the sql server?

601


Explain sql server authentication modes?

612


Call by value and call by reference in procedure and function, with NOCOPY.

838