Buildmasters Legacy Database Documentation

Procedure: Northwind.dbo.CustOrdersDetail

CollapseAll image

Collapse image Procedure Properties

 Name   Value 
 Owner   dbo 
 Creation Date   12/13/2004 
 Type   Standard T-SQL 
 Encrypted 
 ID   789577851 
 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 
@OrderID   int 4 Input

Collapse image Recordsets returned

  Name  DataType  Max Length 
ProductName nvarchar 40
UnitPrice money 8
Quantity smallint 2
Discount int 4
ExtendedPrice money 8

Collapse image Objects that depend on CustOrdersDetail

No dependencies exist

Collapse image 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
Total 8 object(s)

Collapse image 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
Total 7 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 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

Collapse image See also

List of Procedures


Buildmasters.com.au




Buildmasters Legacy Database Documentation