Stored Procedures [dbo].[EmailApiGetOutgoingEmailInvoiceAttachments]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inOutgoingEmailIdsIntListmax
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE PROCEDURE [dbo].[EmailApiGetOutgoingEmailInvoiceAttachments]
    @inOutgoingEmailIds IntList readonly
AS
begin
    set nocount on
    select
        OutgoingEmailId = OutgoingEmailIds.Item,
        Content = InvoicedImage.InvoicedImage,
        InvoiceNumber = InvoicedHeader.InvoiceNumber,
        FileExtension = ReportArchiveType.FileExtension,
        AttachmentPosition = OutgoingEmailInvoiceAttachment.AttachmentOrder
    from @inOutgoingEmailIds OutgoingEmailIds
    inner join OutgoingEmailInvoiceAttachment on OutgoingEmailIds.Item = OutgoingEmailInvoiceAttachment.OutgoingEmailFID
    inner join InvoicedHeader on OutgoingEmailInvoiceAttachment.InvoicedHeaderFID = InvoicedHeader.IHPriKey
    inner join InvoicedImage on InvoicedHeader.IHPriKey = InvoicedImage.InvoicedHeaderFID
    inner join ReportArchiveType on InvoicedImage.ReportArchiveTypeFID = ReportArchiveType.ReportArchiveTypeID
end
GO
GRANT EXECUTE ON  [dbo].[EmailApiGetOutgoingEmailInvoiceAttachments] TO [MssExec]
GO
Uses