I have an ordering system where when a new order is placed it is inserted into my table Orders. From there I want to insert the new id into another table Importance which also needs an id from a third table called ImportanceRating.
Table structures:
Order
- OrderId uniqueidentifier
- TimeOrderPlaced datetime
- ProductId uniqueidentifier
- EstimatedDeliveryTime datetime
Importance
- FK_OrderId uniqueidentifier
- FK_ImpRatingId uniqueidentifier
ImportanceRating
- ImpRatingId uniqueidentifier
- RatingTitle varchar(50)
All of this I want merged in 1 stored procedure. How would I go about with this?
Links to good guides on the subject is more than welcome.
I'm a SPROC newbie