"ProductDetail" Stored Procedure

Description:

This stored procedure accepts a ProductID as an input parameter and returns product information to the caller in the form of output parameters.  A one line recordset is not used in order to gain a performance increase.  It is used primarily on the product details screen.

Definition:

    CREATE Procedure ProductDetail
    (
        @ProductID    int,
        @ModelNumber  nvarchar(50) OUTPUT,
        @ModelName    nvarchar(50) OUTPUT,
        @ProductImage nvarchar(50) OUTPUT,
        @UnitCost     money OUTPUT,
        @Description  nvarchar(4000) OUTPUT
    )
    AS

    SELECT
        @ProductID    = ProductID,
        @ModelNumber  = ModelNumber,
        @ModelName    = ModelName,
        @ProductImage = ProductImage,
        @UnitCost     = UnitCost,
        @Description  = Description

    FROM
        Products

    WHERE
        ProductID = @ProductID
        
Database Tables Used:

Products:  The Products table contains all of the information about all of the products on the IBuySpy web site. Its primary key is the ProductID identity field.  Note that product descriptions are limited to 3800 characters.