Watch Our YouTube Channel
It is currently Wed Jan 24, 2018 3:19 am
 

All times are UTC



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Apr 04, 2016 8:47 am 
Offline

Joined: Fri Nov 13, 2015 3:56 am
Posts: 460
CHAR data type:
It is a fixed length data type.
Uses static memory allocation.
Supports both Character & Numbers.
Used to store non-Unicode characters.
The maximum no. of characters the data type can hold is 255 characters.
Supports 2000 characters.
Occupies 1 byte of space for each character.
It's 50% faster than VARCHAR.
The ISO synonym for char is character.
Declaration: Once we declare char(50) and insert only 10 characters of word then only 10 characters of memory will be usedand other 40 characters of memory will be wasted.

VARCHAR data type:
It is a variable length data type.
Uses dynamic memory allocation.
Supports both Character & Numbers.
Used to store non-Unicode characters.
Supports 4000 characters.
Occupies 1 byte of space for each character.
It's slower than CHAR.
The ISO synonyms for varchar are char varying or character varying.
Declaration: Once we declare varchar(50) and insert only 10 characters of word it will allocate memory for only 10 characters.

NCHAR data type:
Is a fixed length data type.
nchar requires more space than nvarchar.
Used to store Unicode characters.
Maximum length of 4000 characters.
Occupies 2 bytes of space for each character.
The ISO synonyms for nchar are national char and national character.
nchar(10) is a fixed-length Unicode string of length 10.

NVARCHAR data type:
nvarchar datatype same as varchar datatype but only difference nvarchar is used to store Unicode characters and it allows you to store multiple languages in database.
It is a variable length data type.
nvarchar datatype will take twice as much space to store extended set of characters as required by other languages.
Used to store Unicode characters
Occupies 2 bytes of space for each character.
The ISO synonyms for nvarchar are national char varying and national character varying.
nvarchar(10) is a variable-length Unicode string with a maximum length of 10.

_________________
Learn Web Development | Latest Technology News |Motivational Quotes


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron