C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Different between Nchar and varchar data type?


Posted Date: 05 May 2008    Resource Type: Definitions    Category: General
Author: Vijaykumar PatilMember Level: Gold    
Rating: Points: 5



N stands for national character, and it is meant for Unicode data. Using Unicode data types, a column can store any character defined by the Unicode Standard, which includes all of the characters defined in the various character sets. Unicode data types take twice as much storage space as non-Unicode data types.
Keep in mind that an nchar or nvarchar or ntext datatype takes up twice as much storage as its non-unicode equivalent. This includes space on disk as well as in your buffer cache. So use the unicode data types only where necessary.

VARCHAR and NVARCHAR data types are both character data types that are variable-length. Below is the summary of the differences between these 2 data types:

VARCHAR (n) & NVARCHAR (n)
Character Data Type Non-Unicode Data & Unicode Data
Maximum Length 8,000 & 4,000
Character Size 1 byte & 2 bytes
Storage Size Actual Length (in bytes) & 2 times Actual Length (in bytes)

You would use NVARCHAR data type for columns that store characters from more than one character set or when you will be using characters that require 2-byte characters, which are basically the Unicode characters such as the Japanese Kanji or Korean Hangul characters.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: CLR
Previous Resource: SCOPE_IDENTITY in SQL SERVER
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use