I have created 2 tables in sql server 2000 and they have Relation between them:
(1) tblCustomer
columns: custid (PK); custname
(2) tblOrder
columns: orderid; customer_id (FK); order
I want to write the sql statement (INSERT) to insert a record with all fields.
I dont want to inculde the customerid (FK) in the sql statement (because the tblOrder.customerid should get the matching value of tblCustomer.custid otherwise how will the relationship between the tables exist). I dont know if I was able to convey the problem. If someone understands pls provide me with the resolution.
(1) tblCustomer
columns: custid (PK); custname
(2) tblOrder
columns: orderid; customer_id (FK); order
I want to write the sql statement (INSERT) to insert a record with all fields.
I dont want to inculde the customerid (FK) in the sql statement (because the tblOrder.customerid should get the matching value of tblCustomer.custid otherwise how will the relationship between the tables exist). I dont know if I was able to convey the problem. If someone understands pls provide me with the resolution.