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
What is the command used to recompile the stored procedure at run time?
How to insert stored procedure result into temporary table?
How to use linked server?
How to update a field in SQL after ALTERING a row?
What is 'Join' and explain its various types.
What is transaction server consistency?
Explain error and transaction handling in sql server?
what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration
What is PROJECTION Operation?
Explain what is analysis service repository?
What are the disadvantages of merge replication?
What are the restrictions that views have to follow?
What are the properties of the transactions?
What is table join?
What is the purpose of floor function?