sql - Insert data to tables -
I want to realize the order operation with inserting data and user input data. I have made this applause:
order | OrderID - PK | Customer ID - FK | Order date | Order Details | OrderID - PK, FK | Manufacturer - PK, FK. Volume | Customer | Customer ID - PK | First name Last name | Address Products | Manufacturer - PK | | SuperverID - FK | | Volume | Supplier | Supplier ID - PK | Name | I want to use the stored procedure to insert data, but I have trouble creating T-SQL
If I understand the question correctly, then you want to know which order to insert the data in the table to ensure that it is correct ?
From your post, it seems that you enter this order:
- Customers / Products / Suppliers (these can all be put in any order).
- Order - This can only be done in the Customer Table because it requires a valid customer
- Order Details - Requires Entry in the Order Table and Product Table for it .
The volume column will be on the OrderDetail table, because you can be more than one of each line item.
Comments
Post a Comment