-
Best way to create database
Good Morning Everyone,
For the below example of tables connected together with foreign keys, is there a better way to insert data into Table1 other than having to look up the primary key of the customer and the primary key of the product and then use
insert into Table1 values (1,2)
If you have fifty child tables it seems like so much extra work to have to look up every primary key before you can create your insert statement. Is there a way to make it more like
insert into Table1 values ('CustomerA','ProductB') and have it automatically lookup the keys and input them for you???
Table1
PrimaryKey
ID2 (FK to PK Table2)
ID3 (FK to PK Table2)
ID4 (FK to PK Table2)
Table2 (child)
PrimaryKey
Customer
Table3 (child)
PrimaryKey
Product
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|