Stored Procedures [dbo].[MssWebGetAccountProfileDocuments]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@accountProfileIdint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE PROCEDURE [dbo].[MssWebGetAccountProfileDocuments]
    @accountProfileId    INT
AS

set nocount on

select
    AccountProfileDocumentId = AccountProfileDocument.AccountProfileDocumentID,
    AccountProfileDocument.DocumentName,
    AccountProfileDocument.DocumentDescription,
    DocumentGroup = AccountProfileDocumentGroup.[Description],
    GroupSortOrder = AccountProfileDocumentGroup.[SortBy],
    DocumentType = AccountProfileDocumentType.[Description],
    AttachedBy = dbo.FormatFirstNameLastName( AttachedBy.FIRSTNAME, AttachedBy.LASTNAME ),
    AccountProfileDocument.AttachedOn,
    AccountProfileDocument.LastModified,
    Notes = AccountProfileDocument.DocumentNotes
from AccountProfileDocument
inner join AccountProfileDocumentType on
    AccountProfileDocument.AccountProfileDocumentTypeFID = AccountProfileDocumentType.AccountProfileDocumentTypeID
inner join AccountProfileDocumentGroup on
    AccountProfileDocumentType.AccountProfileDocumentGroupFID = AccountProfileDocumentGroup.AccountProfileDocumentGroupID
inner join SysUser AttachedBy on
    AccountProfileDocument.AttachedByFID = AttachedBy.SysUserID
where
    AccountProfileDocument.AccountProfileFID = @accountProfileId and
    AccountProfileDocument.Inactive = 0
GO
GRANT EXECUTE ON  [dbo].[MssWebGetAccountProfileDocuments] TO [MssExec]
GO
Uses