"GetSingleContact" 存储过程

描述:

This 存储过程 returns a single contact item from the database. The input parameter is ItemID, the primary key for the record. The return values include the contact details, as well as information about the users that created and last edited this item.

This 存储过程 is used by the edit page for Contacts.

定义:
    
    CREATE PROCEDURE GetSingleContact
    (
        @ItemID int
    )
    AS

    SELECT
        CreatedByUser,
        CreatedDate,
        Name,
        Role,
        Email,
        Contact1,
        Contact2

    FROM
        Contacts

    WHERE
        ItemID = @ItemID
        
使用的数据库中的表:

Contacts:  Each record in the Contacts table is a single item, as displayed by the Contacts Portal Module. Since all Contacts modules store their record in this table, each item contains a ModuleID to permit related items to be retrieved in a single query.

The primary key in this table is the ItemID identity field.