"GetContacts" Stored Procedure

Description:

This stored procedure returns all of the contacts for a specific Contact module within the portal. The input parameters is the ModuleID.

Definition:
    
    CREATE PROCEDURE GetContacts
    (
        @ModuleID int
    )
    AS

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

    FROM
        Contacts

    WHERE
        ModuleID = @ModuleID
        
Database Tables Used:

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.