dbTalk Databases Forums  

nvarchar & varchar

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss nvarchar & varchar in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
haidani@gmail.com
 
Posts: n/a

Default nvarchar & varchar - 02-26-2007 , 08:47 AM






Hi,

I am new to MS SQL. When I create a column in a table, when shall I
use nvarchar or varchar? Please help.

Thanks,
Mike


Reply With Quote
  #2  
Old   
Plamen Ratchev
 
Posts: n/a

Default Re: nvarchar & varchar - 02-26-2007 , 09:13 AM






The nvarchar data type provides support for Unicode characters. This is
needed if you are building an international system that must store different
languages. However, if you have no need to store Unicode characters then you
are better using varchar. The nvarchar data type occupies twice the space of
varchar as it uses 2 bytes to encode each character.

HTH,

Plamen Ratchev
http://www.SQLStudio.com



Reply With Quote
  #3  
Old   
oliver
 
Posts: n/a

Default Re: nvarchar & varchar - 02-26-2007 , 09:26 AM



On 26 Feb, 15:13, "Plamen Ratchev" <Pla... (AT) SQLStudio (DOT) com> wrote:
Quote:
The nvarchar data type provides support for Unicode characters. This is
needed if you are building an international system that must store different
languages. However, if you have no need to store Unicode characters then you
are better using varchar. The nvarchar data type occupies twice the space of
varchar as it uses 2 bytes to encode each character.

HTH,

Plamen Ratchevhttp://www.SQLStudio.com
varchar will support a lot of characters from different languages
though (depending on the collation codepage) so no need to rush into
doubling your storage if you dont "really" need to



Reply With Quote
  #4  
Old   
Michael
 
Posts: n/a

Default Re: nvarchar & varchar - 02-26-2007 , 10:40 AM



On Feb 26, 10:26 am, "oliver" <oraus... (AT) hotmail (DOT) com> wrote:
Quote:
On 26 Feb, 15:13, "Plamen Ratchev" <Pla... (AT) SQLStudio (DOT) com> wrote:

The nvarchar data type provides support for Unicode characters. This is
needed if you are building an international system that must store different
languages. However, if you have no need to store Unicode characters then you
are better using varchar. The nvarchar data type occupies twice the space of
varchar as it uses 2 bytes to encode each character.

HTH,

Plamen Ratchevhttp://www.SQLStudio.com

varchar will support a lot of characters from different languages
though (depending on the collation codepage) so no need to rush into
doubling your storage if you dont "really" need to
Plamen, Oliver Thanks a lot!

Mike



Reply With Quote
  #5  
Old   
Carl Tegeder
 
Posts: n/a

Default Re: nvarchar & varchar - 02-26-2007 , 06:30 PM



On Feb 26, 9:47 am, haid... (AT) gmail (DOT) com wrote:
Quote:
Hi,

I am new to MS SQL. When I create a column in a table, when shall I
use nvarchar or varchar? Please help.

Thanks,
Mike
Mike,

Clearly you need to go back to reading the manual or get a Dummy's
book if you don't know the difference between unicode and ascii
strings.

HTH,

Carl Tegeder
Master MS-SQL Administrator



Reply With Quote
  #6  
Old   
Ed Murphy
 
Posts: n/a

Default Re: nvarchar & varchar - 02-26-2007 , 11:28 PM



Carl Tegeder wrote:

Quote:
I am new to MS SQL. When I create a column in a table, when shall I
use nvarchar or varchar? Please help.

Clearly you need to go back to reading the manual or get a Dummy's
book if you don't know the difference between unicode and ascii
strings.
Not the most tactful of responses, but hey.

To the original poster: Google and Wikipedia are your friends.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.