"GetAnnouncements" Stored Procedure

Description:

This stored procedure returns all of the announcements for a specific Announcement module within the portal. The input parameters are ModuleID and PortalID. Only announcements whose expiration date is later than today are shown.

Definition:
    
   CREATE PROCEDURE Portal_GetAnnouncements
   (
       @ModuleID int
   )
   AS
   
   SELECT
       ItemID,
       CreatedByUser,
       CreatedDate,
       Title,
       MoreLink,
       MobileMoreLink,
       ExpireDate,
       Description
   
   FROM Portal_Announcements
   
   WHERE
       ModuleID = @ModuleID
     AND
       ExpireDate > GetDate()
        
Database Tables Used:

Announcements:  Each record in the Announcements table is a single item, as displayed by the Announcements Portal Module. Since all Announcement 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. Note that announcement descriptions are limited to 2000 characters.