[dbo].[OutgoingEmailInlineAttachment]
CREATE TABLE [dbo].[OutgoingEmailInlineAttachment]
(
[OutgoingEmailInlineAttachmentId] [int] NOT NULL IDENTITY(1, 1),
[OutgoingEmailFID] [int] NOT NULL,
[ContentId] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MimeType] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Content] [varbinary] (max) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[OutgoingEmailInlineAttachment] ADD CONSTRAINT [PK_OutgoingEmailInlineAttachment] PRIMARY KEY NONCLUSTERED ([OutgoingEmailInlineAttachmentId]) ON [PRIMARY]
GO
CREATE UNIQUE CLUSTERED INDEX [IX_OutgoingEmailInlineAttachment_OutgoingEmailFID_ContentId] ON [dbo].[OutgoingEmailInlineAttachment] ([OutgoingEmailFID], [ContentId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OutgoingEmailInlineAttachment] ADD CONSTRAINT [FK_OutgoingEmailInlineAttachment_OutgoingEmail] FOREIGN KEY ([OutgoingEmailFID]) REFERENCES [dbo].[OutgoingEmail] ([OutgoingEmailID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[OutgoingEmailInlineAttachment] TO [MssExec]
GRANT INSERT ON [dbo].[OutgoingEmailInlineAttachment] TO [MssExec]
GRANT DELETE ON [dbo].[OutgoingEmailInlineAttachment] TO [MssExec]
GRANT UPDATE ON [dbo].[OutgoingEmailInlineAttachment] TO [MssExec]
GO