Buildmasters Legacy Database Documentation

Procedure: Northwind.dbo.CustOrderHist

CollapseAll image

Collapse image Procedure Properties

 Name   Value 
 Owner   dbo 
 Creation Date   12/13/2004 
 Type   Standard T-SQL 
 Encrypted 
 ID   821577965 
 Implementation Type   Transact SQL 

Collapse image Creation options

Name Value
QUOTED_IDENTIFIER ON
ANSI_NULLS ON

Collapse image Parameters

  Name  Description DataType  Max Length  Type 
@CustomerID   nchar 5 Input

Collapse image Recordsets returned

  Name  DataType  Max Length 
ProductName nvarchar 40
Total int 4

Collapse image Objects that depend on CustOrderHist

No dependencies exist

Collapse image Objects that CustOrderHist depends on

  Object Name Object Type Dep Level
Customers Table 1
[Order Details] Table 1
Orders Table 1
Products Table 1
Categories Table 2
Employees Table 2
Shippers Table 2
Suppliers Table 2
Total 8 object(s)

Collapse image Column Level Dependencies

  Object Name Column Object Type
Products ProductName Table
Products ProductID Table
[Order Details] Quantity Table
[Order Details] OrderID Table
[Order Details] ProductID Table
Orders CustomerID Table
Orders OrderID Table
Customers CustomerID Table
Total 8 column(s)

Collapse image Graphical Dependencies

Click Here to view Dependencies Graphically

Collapse image Permissions

No permissions defined

Collapse image Extended Properties

No extended properties defined

Collapse image SQL

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE CustOrderHist @CustomerID nchar(5)
AS
SELECT ProductName, Total=SUM(Quantity)
FROM Products P, [Order Details] OD, Orders O, Customers C
WHERE C.CustomerID = @CustomerID
AND C.CustomerID = O.CustomerID AND O.OrderID = OD.OrderID AND OD.ProductID = P.ProductID
GROUP BY ProductName
GO

Collapse image See also

List of Procedures


Buildmasters.com.au




Buildmasters Legacy Database Documentation