Procedure:
Northwind.dbo.CustOrdersDetail
Procedure Properties
| Name | Value |
| Owner | dbo |
| Creation Date | 12/13/2004 |
| Type | Standard T-SQL |
| Encrypted | ![]() |
| ID | 789577851 |
| Implementation Type | Transact SQL |
Creation options
| Name | Value |
| QUOTED_IDENTIFIER | ON |
| ANSI_NULLS | ON |
Parameters
| Name | Description | DataType | Max Length | Type | |
![]() |
@OrderID | int | 4 | Input |
Recordsets returned
| Name | DataType | Max Length | |
![]() |
ProductName | nvarchar | 40 |
![]() |
UnitPrice | money | 8 |
![]() |
Quantity | smallint | 2 |
![]() |
Discount | int | 4 |
![]() |
ExtendedPrice | money | 8 |
Objects that depend on CustOrdersDetail
Objects that CustOrdersDetail depends on
| Object Name | Object Type | Dep Level | |
![]() |
[Order Details] | Table | 1 |
![]() |
Products | Table | 1 |
![]() |
Categories | Table | 2 |
![]() |
Orders | Table | 2 |
![]() |
Suppliers | Table | 2 |
![]() |
Customers | Table | 3 |
![]() |
Employees | Table | 3 |
![]() |
Shippers | Table | 3 |
Column Level Dependencies
| Object Name | Column | Object Type | |
![]() |
Products | ProductName | Table |
![]() |
Products | ProductID | Table |
![]() |
[Order Details] | UnitPrice | Table |
![]() |
[Order Details] | Quantity | Table |
![]() |
[Order Details] | Discount | Table |
![]() |
[Order Details] | ProductID | Table |
![]() |
[Order Details] | OrderID | Table |
Graphical Dependencies
Permissions
Extended Properties
SQL
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE CustOrdersDetail @OrderID int AS SELECT ProductName, UnitPrice=ROUND(Od.UnitPrice, 2), Quantity, Discount=CONVERT(int, Discount * 100), ExtendedPrice=ROUND(CONVERT(money, Quantity * (1 - Discount) * Od.UnitPrice), 2) FROM Products P, [Order Details] Od WHERE Od.ProductID = P.ProductID and Od.OrderID = @OrderID GO |
See also