CREATE TABLE [dbo].[DashboardAccountsByInterval]
(
[AccountID] [int] NOT NULL,
[ColumnIndex] [smallint] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DashboardAccountsByInterval] ADD CONSTRAINT [C_DashboardAccountsByInterval_ColumnIndex] CHECK (([ColumnIndex]>=(1) AND [ColumnIndex]<=(57)))
GO
ALTER TABLE [dbo].[DashboardAccountsByInterval] ADD CONSTRAINT [PK_DashboardAccountsByInterval_AccountID_ColumnIndex] PRIMARY KEY CLUSTERED ([AccountID], [ColumnIndex]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DashboardAccountsByInterval] ADD CONSTRAINT [FK_DashboardAccountsByInterval_AccountID_Account_AccountID] FOREIGN KEY ([AccountID]) REFERENCES [dbo].[Account] ([AccountID]) ON DELETE CASCADE ON UPDATE CASCADE
GO