If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Lookup table
I have a table customer with two fields customerid and
customer name. There is one more table sales with customerid and customer name in it. The relationship is one to many ( Customer to sales ) Now this is what I want to be working in table. As soon as I enter a new record with the customer id in sales table it should get the customer name from customer table and fill up the customer name field of sales table. I know this is not a correct design but is it possible? Any suggestions will be highly appreciated. Thanks, San |
#2
|
|||
|
|||
Lookup table
You should not duplicate the customer name in the sales table.
The purpose of the customer table is to store the customer's attributes (such as their name) in one place only. Other tables (such as the sales table) can certainly contain the customer ID (if appropriate), but they should not repeat the customer name etc. You need to learn about "database normalization". Start here for a dry, but instructive read: http://support.microsoft.com/support...es/Q100139.ASP HTH, TC "san" wrote in message ... I have a table customer with two fields customerid and customer name. There is one more table sales with customerid and customer name in it. The relationship is one to many ( Customer to sales ) Now this is what I want to be working in table. As soon as I enter a new record with the customer id in sales table it should get the customer name from customer table and fill up the customer name field of sales table. I know this is not a correct design but is it possible? Any suggestions will be highly appreciated. Thanks, San |
#3
|
|||
|
|||
Lookup table
Further to my comment, I note you say:
I know this is not a correct design but is it possible? Sure it's possible. But that's like saying, "I know I should not pour sugar into the petrol tank of my car, but is it possible?" Sure it's possible!! Cheers, TC |
Thread Tools | |
Display Modes | |
|
|