USE [AdventureWorks]
GO
CREATE VIEW [Sales].[vSalesOrderWithDetails]
AS
SELECT Sales.SalesOrderDetail.SalesOrderID, Sales.SalesOrderDetail.SalesOrderDetailID, Sales.SalesOrderHeader.OrderDate, Sales.SalesOrderHeader.CustomerID, 
   Sales.SalesOrderHeader.SalesPersonID, Sales.SalesOrderDetail.ProductID, Production.Product.Name, Sales.SalesOrderDetail.OrderQty, 
   Sales.SalesOrderDetail.UnitPrice, Sales.SalesOrderDetail.LineTotal
FROM  Sales.SalesOrderDetail INNER JOIN
   Sales.SalesOrderHeader ON Sales.SalesOrderDetail.SalesOrderID = Sales.SalesOrderHeader.SalesOrderID INNER JOIN
  Production.Product ON Sales.SalesOrderDetail.ProductID = Production.Product.ProductID

GO
