"GetDocuments" Stored Procedure

Description:

This stored procedure returns all of the documents for a specific Documents module within the portal. The input parameter is the ModuleID.

Definition:
    
   CREATE PROCEDURE Portal_GetDocuments
   (
       @ModuleID int
   )
   AS
   
   SELECT
       ItemID,
       FileFriendlyName,
       FileNameUrl,
       CreatedByUser,
       CreatedDate,
       Category,
       ContentSize
       
   FROM Portal_Documents
   
   WHERE
       ModuleID = @ModuleID
        
Database Tables Used:

Documents:  Each record in the Documents table is a single item, as displayed by the Documents Portal Module. Since all Documents 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.