Stored Procedures [dbo].[AttachLocalFileToOutgoingEmail]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inOutgoingEmailIdint4
@inFileNamenvarchar(128)256
@inContentvarbinary(max)max
@inAttachmentOrderint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE PROCEDURE [dbo].[AttachLocalFileToOutgoingEmail]
    @inOutgoingEmailId int,
    @inFileName nvarchar(128),
    @inContent varbinary(max),
    @inAttachmentOrder int
AS
begin
set nocount on
    insert into OutgoingEmailFileAttachment(
        OutgoingEmailFID,
        Content,
        [FileName],
        AttachmentOrder
    )
    select
        OutgoingEmailFID = @inOutgoingEmailId,
        Content = @inContent,
        FileName = @inFileName,
        AttachmentOrder = @inAttachmentOrder
end
GO
GRANT EXECUTE ON  [dbo].[AttachLocalFileToOutgoingEmail] TO [MssExec]
GO
Uses