"GetSingleDocument" 存储过程

描述:

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

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

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

    SELECT
        FileFriendlyName,
        FileNameUrl,
        CreatedByUser,
        CreatedDate,
        Category,
        ContentSize

    FROM
        Documents

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

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.