Click to See Complete Forum and Search --> : Primary key


vinodcn
May 4th, 2004, 08:18 AM
can sombody explain advantages and disadvantages of having numeric and alphanumeric key field in a database table.

hspc
May 4th, 2004, 09:06 AM
can sombody explain advantages and disadvantages of having numeric and alphanumeric key field in a database table.

Numeric :
[list=1]
Small size .. numeric fields are generally smaller.
Faster processing.
Can increase insertion speed so much if you make a clustered index on an identity (autonumber) field.
[/list=1]

Alphanumeric :
[list=1]
Can represent formatted strings like ISBNs
you maye need to make a composite PK on Lastname, FirstName columns for example.
Allows much bigger field.. the maximum number of digits in numeric fields is limited is compared with strings..large strings can be useful if you make a special code as a primary key.
[/list=1]

I hope this can help.

vinodcn
May 5th, 2004, 04:23 AM
thanks hspc . hope it will help me

vinodcn
May 5th, 2004, 04:33 AM
thanks hspc . hope it will help me