CREATE TABLE [dbo].[MobileUserLog]
(
[MobileUserLogID] [int] NOT NULL IDENTITY(1, 1),
[MobileAccessFID] [int] NOT NULL,
[Year] [smallint] NOT NULL,
[FeatureSet] [int] NOT NULL,
[Jan] [int] NOT NULL,
[Feb] [int] NOT NULL,
[Mar] [int] NOT NULL,
[Apr] [int] NOT NULL,
[May] [int] NOT NULL,
[Jun] [int] NOT NULL,
[Jul] [int] NOT NULL,
[Aug] [int] NOT NULL,
[Sep] [int] NOT NULL,
[Oct] [int] NOT NULL,
[Nov] [int] NOT NULL,
[Dec] [int] NOT NULL,
[Total] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MobileUserLog] ADD CONSTRAINT [PK_MobileUserLog] PRIMARY KEY CLUSTERED ([MobileUserLogID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MobileUserLog] ADD CONSTRAINT [IX_MobileUserLog_MobileAccess_Year_Feature] UNIQUE NONCLUSTERED ([MobileAccessFID], [Year], [FeatureSet]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MobileUserLog] ADD CONSTRAINT [FK_MobileUserLog_MobileAccess] FOREIGN KEY ([MobileAccessFID]) REFERENCES [dbo].[MobileAccess] ([MobileAccessID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[MobileUserLog] TO [MssExec]
GRANT INSERT ON [dbo].[MobileUserLog] TO [MssExec]
GRANT DELETE ON [dbo].[MobileUserLog] TO [MssExec]
GRANT UPDATE ON [dbo].[MobileUserLog] TO [MssExec]
GO