Friday, February 24, 2012

Data types

Hi everyone,
Which is better to use for datatypes nvarchar or varchar?
In access it is a text datatype. For instance i use in access an column with
datatype text, length 100. When upsizing sql server convert this into
nvarchar(100).
Should i leave it this way or is it better to change it to a suitable
datatype.nvarchar uses twice the storage space but allows for storage of more
characters / symbols to support various languages.
If your access db is in a non enlgish language, it's likely best for you to
use nvarchar.
Regards,
Greg Linwood
SQL Server MVP
"Ezekiël" <ezekiel@.lycos.nl> wrote in message
news:eUnabfTyDHA.1996@.TK2MSFTNGP12.phx.gbl...
> Hi everyone,
> Which is better to use for datatypes nvarchar or varchar?
> In access it is a text datatype. For instance i use in access an column
with
> datatype text, length 100. When upsizing sql server convert this into
> nvarchar(100).
> Should i leave it this way or is it better to change it to a suitable
> datatype.
>|||nvarchar can handle unicode characters
varchar cannot
if you need to deal with these characters for example
french and spanish have accent marks and these are fairly
common within people names and place names, then you need
nvarchar. The downside is that it is twice as large (in
storage terms) as varchar because each character required
two bytes, varchar characters require 1 byte.
regards & Merry Christmas,
Mark Baekdal
www.dbghost.com
>--Original Message--
>Hi everyone,
>Which is better to use for datatypes nvarchar or varchar?
>In access it is a text datatype. For instance i use in
access an column with
>datatype text, length 100. When upsizing sql server
convert this into
>nvarchar(100).
>Should i leave it this way or is it better to change it
to a suitable
>datatype.
>
>.
>|||Hi Mark,
Thx for the explaination. Does the performance sql server decreases if
diskspace is not a problem or does sql not work that way?
"mark baekdal" <anonymous@.discussions.microsoft.com> wrote in message
news:07da01c3c941$52d93650$a301280a@.phx.gbl...
> nvarchar can handle unicode characters
> varchar cannot
> if you need to deal with these characters for example
> french and spanish have accent marks and these are fairly
> common within people names and place names, then you need
> nvarchar. The downside is that it is twice as large (in
> storage terms) as varchar because each character required
> two bytes, varchar characters require 1 byte.
> regards & Merry Christmas,
> Mark Baekdal
> www.dbghost.com
> >--Original Message--
> >Hi everyone,
> >
> >Which is better to use for datatypes nvarchar or varchar?
> >In access it is a text datatype. For instance i use in
> access an column with
> >datatype text, length 100. When upsizing sql server
> convert this into
> >nvarchar(100).
> >
> >Should i leave it this way or is it better to change it
> to a suitable
> >datatype.
> >
> >
> >.
> >|||Performance will decrease... The reason is that rows may be twice as long,
therefore half as many rows will fit on a page... This means,
1. Twice as much IO is required to get the same number of rows
2. The rows take up twice as much space in memory, which means OTHER data
gets bumped out of memory, which means OTHER folks have to do more IO as
well..
Use Nvarchar IF you need to store information in ANY language, But if you
only need to store data in latin based languages,,, varchar would be better.
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Ezekiël" <ezekiel@.lycos.nl> wrote in message
news:eUnabfTyDHA.1996@.TK2MSFTNGP12.phx.gbl...
> Hi everyone,
> Which is better to use for datatypes nvarchar or varchar?
> In access it is a text datatype. For instance i use in access an column
with
> datatype text, length 100. When upsizing sql server convert this into
> nvarchar(100).
> Should i leave it this way or is it better to change it to a suitable
> datatype.
>|||Usually you will have a slight decrease in performance
using nvarchar although this should be neglible.
regards,
Mark Baekdal
www.dbghost.com
>--Original Message--
>Hi Mark,
>Thx for the explaination. Does the performance sql
server decreases if
>diskspace is not a problem or does sql not work that way?
>"mark baekdal" <anonymous@.discussions.microsoft.com>
wrote in message
>news:07da01c3c941$52d93650$a301280a@.phx.gbl...
>> nvarchar can handle unicode characters
>> varchar cannot
>> if you need to deal with these characters for example
>> french and spanish have accent marks and these are
fairly
>> common within people names and place names, then you
need
>> nvarchar. The downside is that it is twice as large (in
>> storage terms) as varchar because each character
required
>> two bytes, varchar characters require 1 byte.
>> regards & Merry Christmas,
>> Mark Baekdal
>> www.dbghost.com
>> >--Original Message--
>> >Hi everyone,
>> >
>> >Which is better to use for datatypes nvarchar or
varchar?
>> >In access it is a text datatype. For instance i use in
>> access an column with
>> >datatype text, length 100. When upsizing sql server
>> convert this into
>> >nvarchar(100).
>> >
>> >Should i leave it this way or is it better to change
it
>> to a suitable
>> >datatype.
>> >
>> >
>> >.
>> >
>
>.
>

No comments:

Post a Comment