title: how to create STORED PROCEDURE to insert data in two tables according to the CustomerID
body: <pre><code>CREATE 
  TABLE Customers(CustomerID int IDENTITY(1,1) PRIMARY KEY,FirstName nvarchar(45),LastName nvarchar(45),Address nvarchar(45))
  
  CREATE 
  TABLE Orders(OrderID int IDENTITY(1,1) PRIMARY KEY,OrderDate date,CustomerID int FOREIGN KEY REFERENCES [dbo].[Customers](CustomerID))
  
  CREATE
  TABLE CustomersOrders(OrderID int FOREIGN KEY REFERENCES [dbo].[Orders](OrderID),ProductName nvarchar(45),Quantity nvarchar(45),Price nvarchar(45),TotalPrice int)
  </code></pre>
  
  <p>how to create STORED PROCEDURE in to insert data in Orders and CustomersOrders two tables according to the [dbo].Customers).</p>
  
  <p>Customers table has entered data with 5 CustomerID</p>
  
  <p>My Database is with first table parent and second is child . Third is the child of second table. I want to </p>
  
  <p>insert data in last two tables according to the CustomerID. The data has to be added with that </p>
  
  <p>particular customerid.</p>