Autonumber vs Textfield

bjackson

Registered User.
Local time
Today, 20:40
Joined
Jan 3, 2003
Messages
404
I am linking to a database that stores data from a VB application.This application uses the first 6 Characters of a Brand and colour as the unique id for the material.

I am just curious to know Why this application wouldnt use an autonumber.When you look at the data its a mish mash of names with the odd - used to separate the materials that had the same character combination

When is the right time to use an auto number ?Is it not faster searching for an id number than a bunch of text?

Regards
Bjackson
 
I'd use an autonumber all the time.

Autonumbers take up four bytes (as Long Integers) to store.
Strings take up an initial eight bytes and then an additional byte per charcter within the string.

In the case of this ID you create, I'd Index it to no duplicates but would use an autonumber as the primary key.
 
Thanks Mile-O-Phile
I'm not sure i can add or change anything in the data base as i dont know what effects it may have on the application that uses it.
I was just curious, as this application is a relative expensive $20,000 s/ware program, that i assume was created by professional programers, all the tables have no primary keys,all the ids for every table are text based using 3 or 4 or 6 characters, and trying to work with it is a real pain,as there is the occassional duplicate id as well.
I thought may be the professional way was using text as the unique id rather than an autonumber

Regards
Bjackson
 

Users who are viewing this thread

Back
Top Bottom