"ProductSearch" Stored Procedure

Description:

This stored procedure accepts a 255 character string and performs the TSQL 'LIKE' command on ModelNumber, ModelName and Description fields of the Product table.  It returns a recordset of matched items.

Definition:

    CREATE Procedure ProductSearch
    (
        @Search nvarchar(255)
    )
    AS

    SELECT
        ProductID,
        ModelName,
        ModelNumber,
        UnitCost,
        ProductImage

    FROM
        Products

    WHERE
        ModelNumber LIKE '%' + @Search + '%'
       OR
        ModelName LIKE '%' + @Search + '%'
       OR
        Description LIKE '%' + @Search + '%'
        
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.