Char or varchar for a primary key?
- From: "D." <d@xxxxx>
- Date: Mon, 28 May 2007 11:50:57 +0200
Hi,
I'm planning the structure of a SqlServer 2005 database for a new
application.
The requirement is that primary keys must be "natural"; i.e. in the table
Customers the primary key will be a max. 10 characters string (but the
string may be filled i.e. with only 5 charachters).
Should I define these primary keys as char[5] or varchar[5]?
I'm interested in your opinion in particular about performace issue, because
there will be tables with millions of records...
Thanks,
Davide.
.
- Follow-Ups:
- Re: Char or varchar for a primary key?
- From: Gert-Jan Strik
- Re: Char or varchar for a primary key?
- From: Erland Sommarskog
- Re: Char or varchar for a primary key?
- From: D.
- Re: Char or varchar for a primary key?
- Prev by Date: Re: Database design
- Next by Date: Re: Char or varchar for a primary key?
- Previous by thread: Custom Software Development
- Next by thread: Re: Char or varchar for a primary key?
- Index(es):
Relevant Pages
|