[dbo].[MssWebGetAccountProfileDocuments]
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