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
How to create “dependant” parameter “make, model, year”
How will you make an attribute not process? : sql server analysis services, ssas
What are the types of indexing?
What is difference between views and tables?
Which table keeps the locking information?
What is spid in sql server profiler?
What are the source of constraints?
Tell me what is the stuff and how does it differ from the replace function?
What is named query? : sql server analysis services, ssas
What are different types of table joins?
What is the difference between update lock and exclusive lock?
How to convert a table data in XML format in sql server?
What do you mean by table and field in sql?
What does top operator do?
Is sql server a database?