I am trying to add a new record into a Quantity table based on a record that is automatically added to an Order table. Would need the ProductID, LocationID, and OrderQuantity to add a record to the Quantity table. Using SQL Server 2022. How do I create a trigger to send the three needed pieces of data to the order table automatically as a new record there?
Orders
OrderID Int Identity PK
ProductID Int FK
UserID Nvarchar(50)
OrderDate Date
OrderQuantity Int
LocationID Nchar(10) FK
Quantity
ProductID Int
LocationID Nchar(10)
Instock Decimal
PK ProductID + LocationID
lee bowers is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3