CREATE TABLE [dbo].[BiReportingView]
(
[BiReportingViewID] [int] NOT NULL IDENTITY(1, 1),
[CreateOrder] [int] NULL,
[ViewName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Alias] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[BiReportingBusinessCategoryFID] [int] NOT NULL,
[ViewSql] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Defaults] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MustHaveGp] [bit] NOT NULL CONSTRAINT [DF_BiReportingView_MustHaveGp] DEFAULT ((0))
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[BiReportingView] ADD CONSTRAINT [PK_BiReportingView] PRIMARY KEY NONCLUSTERED ([BiReportingViewID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BiReportingView] ADD CONSTRAINT [IX_BiReportingView_ViewName] UNIQUE NONCLUSTERED ([ViewName]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BiReportingView] ADD CONSTRAINT [FK_BiReportingView_BiReportingBusinessCategoryFID] FOREIGN KEY ([BiReportingBusinessCategoryFID]) REFERENCES [dbo].[BiReportingBusinessCategory] ([BiReportingBusinessCategoryID])
GO
GRANT SELECT ON [dbo].[BiReportingView] TO [MssExec]
GRANT INSERT ON [dbo].[BiReportingView] TO [MssExec]
GRANT DELETE ON [dbo].[BiReportingView] TO [MssExec]
GRANT UPDATE ON [dbo].[BiReportingView] TO [MssExec]
GO