?
Solved

Difference between Varchar and NVarchar ?

Posted on 2005-03-08
5
Medium Priority
?
1,164 Views
Last Modified: 2008-02-01
What is the difference between nvarchar and varchar?
0
Comment
Question by:jjacksn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 5

Accepted Solution

by:
xnmb earned 500 total points
ID: 13493655
nvarchar can hold both ascii and unicode characters while varchar can only hold ascii characters. nvarchar consumes 2 bytes per character while varchar consumes only 1 byte per character.
0
 
LVL 5

Expert Comment

by:xnmb
ID: 13493660
btw, you can easily look that up on BOL for a more  elaborate explanation.
0
 

Assisted Solution

by:montaleast13
montaleast13 earned 500 total points
ID: 13493672
Hello,

varchar stores no-unicode data. The maximum length of the data is up to 8000 characters.  nvarchar stores unicode data. The maximum length of the data is up to 4000 characters.  

Hope it helps.

montaleast13 :-)
0
 
LVL 5

Author Comment

by:jjacksn
ID: 13493720
BOL?
0
 
LVL 14

Expert Comment

by:Renante Entera
ID: 13493741
Hi jjacksn!

Eventhough that you have already accepted an answer.  Perhaps, it is still useful if I post some comments in here.

You may visit the following sites for some additional information :

char and varchar - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ca-co_7tpu.asp
nchar and nvarchar - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_na-nop_9msy.asp

Hope this helps you.


Regards!
eNTRANCE2002 :-)
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question