Tables [dbo].[EmailHistory]
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created1:20:02 AM Thursday, March 21, 2019
Last Modified1:20:24 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow NullsIdentity
Cluster Primary Key PK_EmailHistory_EmailID: EmailIDEmailIDint4
False
1 - 1
Foreign Keys FK_EmailHistory_AccountID_Account_AccountID: [dbo].[Account].AccountIDAccountIDint4
False
Statusnvarchar(2048)4096
True
EmailTypesmallint2
False
Datedatetime8
False
Subjectnvarchar(1024)2048
False
SentFromnvarchar(200)400
False
SentTonvarchar(4000)8000
False
Bodynvarchar(max)max
True
SentOkbit1
False
AttachmentTypevarchar(1024)1024
True
Attachmentvarbinary(max)max
True
Foreign Keys FK_EmailHistory_ScheduledReportID_ScheduledReportSettings_ID: [dbo].[ScheduledReportSettings].ScheduledReportIDScheduledReportIDint4
True
KeyNameKey ColumnsUnique
Cluster Primary Key PK_EmailHistory_EmailID: EmailIDPK_EmailHistory_EmailIDEmailID
True
NameDeleteColumns
FK_EmailHistory_AccountID_Account_AccountIDCascadeAccountID->[dbo].[Account].[AccountID]
FK_EmailHistory_ScheduledReportID_ScheduledReportSettings_IDScheduledReportID->[dbo].[ScheduledReportSettings].[ID]
CREATE TABLE [dbo].[EmailHistory]
(
[EmailID] [int] NOT NULL IDENTITY(1, 1),
[AccountID] [int] NOT NULL,
[Status] [nvarchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[EmailType] [smallint] NOT NULL,
[Date] [datetime] NOT NULL,
[Subject] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SentFrom] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SentTo] [nvarchar] (4000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Body] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SentOk] [bit] NOT NULL,
[AttachmentType] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Attachment] [varbinary] (max) NULL,
[ScheduledReportID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[EmailHistory] ADD CONSTRAINT [PK_EmailHistory_EmailID] PRIMARY KEY CLUSTERED  ([EmailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[EmailHistory] ADD CONSTRAINT [FK_EmailHistory_AccountID_Account_AccountID] FOREIGN KEY ([AccountID]) REFERENCES [dbo].[Account] ([AccountID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[EmailHistory] ADD CONSTRAINT [FK_EmailHistory_ScheduledReportID_ScheduledReportSettings_ID] FOREIGN KEY ([ScheduledReportID]) REFERENCES [dbo].[ScheduledReportSettings] ([ID])
GO