- Local time
- Today, 22:47
- Joined
- Sep 12, 2006
- Messages
- 16,056
100% agree with Rain.
Add an autonumber as the PK for the vehicle to use as a foreign key in conjunction with driver details, service scheduling, etc etc. Add an index/no duplicates to the vehicle table to manage the registration numbers, using the RegNo field.
(Don't use the VIN number either for the PK, or anything special about the car - as you won't want the bother of having to record details of that nature. By all means store the VIN as a bit if info. )
Then if a number does change (private plate, or just an error) there are no cascading updates to worry about.
Note that it is possible for the same regno to be on two cars. We just moved a regno from one of our cars to the other.
Add an autonumber as the PK for the vehicle to use as a foreign key in conjunction with driver details, service scheduling, etc etc. Add an index/no duplicates to the vehicle table to manage the registration numbers, using the RegNo field.
(Don't use the VIN number either for the PK, or anything special about the car - as you won't want the bother of having to record details of that nature. By all means store the VIN as a bit if info. )
Then if a number does change (private plate, or just an error) there are no cascading updates to worry about.
Note that it is possible for the same regno to be on two cars. We just moved a regno from one of our cars to the other.