Procedure:
Northwind.dbo.CustOrderHist
Procedure Properties
| Name | Value |
| Owner | dbo |
| Creation Date | 12/13/2004 |
| Type | Standard T-SQL |
| Encrypted | ![]() |
| ID | 821577965 |
| Implementation Type | Transact SQL |
Creation options
| Name | Value |
| QUOTED_IDENTIFIER | ON |
| ANSI_NULLS | ON |
Parameters
| Name | Description | DataType | Max Length | Type | |
![]() |
@CustomerID | nchar | 5 | Input |
Recordsets returned
| Name | DataType | Max Length | |
![]() |
ProductName | nvarchar | 40 |
![]() |
Total | int | 4 |
Objects that depend on CustOrderHist
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 |
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 |
Graphical Dependencies
Permissions
Extended Properties
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 |
See also