Storing Text

V

Vayse

Hi
What do people use for storing text?
In Access, I used Text. (of course!)
In SQL, there's Char, nchar, VarChar, nvarchar and Text.
For ADP projects, is there a particular type I should choose?

I've used VarChar, and it pads out the string to the appropiate lenght. So
I'm looking for a way around this, withour resorting to Trim.
Thanks
Diarmuid
 
N

Norman Yuan

VatChar or NVarchar does not pad string to appropriate long, Char or NChar
does.
 
R

Robert Morley

Varchar and nvarchar are what you'll probably use most.

Char and nchar will pad your text to however long you specify, and are most
useful for storing ID's, maybe phone/fax numbers (if they don't have
extensions and they're not international), postal codes (again, if they're
not international), that sort of thing.

The deciding factor for whether to use the nchar/nvarchar types is usually
whether you expect to have non-English characters in that field. If you
expect to use non-English characters, use nchar/nvarchar, otherwise there's
probably no need to.



Rob
 
V

Vayse

Thanks.
There's a few things that are different, will hopefully get the hang of this
adp stuff soon. Still, its nice to learn something new!
Diarmuid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top