Stored Procedures [dbo].[EmailApiGetOutgoingEmailDocumentAttachments]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inOutgoingEmailIdsIntListmax
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE PROCEDURE [dbo].[EmailApiGetOutgoingEmailDocumentAttachments]
    @inOutgoingEmailIds IntList readonly
AS
begin
    set nocount on
    select
        OutgoingEmailId = OutgoingEmailDocumentAttachment.OutgoingEmailFID,
        [FileName] = MssDocumentImage.DocumentName,
        AttachmentPosition = OutgoingEmailDocumentAttachment.AttachmentOrder,
        MssDocumentId = OutgoingEmailDocumentAttachment.MssDocumentFID
    from @inOutgoingEmailIds inOutgoingEmailIds
    inner join OutgoingEmailDocumentAttachment on
        inOutgoingEmailIds.Item = OutgoingEmailDocumentAttachment.OutgoingEmailFID
    inner join MssDocument on OutgoingEmailDocumentAttachment.MssDocumentFID = MssDocument.MSSDocumentID
    inner join MssDocumentImage on MssDocument.MSSDocumentImageFID = MssDocumentImage.MSSDocumentImageID

end
GO
GRANT EXECUTE ON  [dbo].[EmailApiGetOutgoingEmailDocumentAttachments] TO [MssExec]
GO
Uses