[dbo].[ReportingUserAccess]
CREATE TABLE [dbo].[ReportingUserAccess]
(
[ReportingUserAccessID] [int] NOT NULL IDENTITY(1, 1),
[ReportingUserFID] [int] NOT NULL,
[UserID] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Password] [varbinary] (128) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportingUserAccess] ADD CONSTRAINT [CK_ReportingUserAccess_UserAccess] CHECK (([dbo].[UserIdInUserAccess]([UserID])=(0)))
GO
ALTER TABLE [dbo].[ReportingUserAccess] ADD CONSTRAINT [PK_ReportingUserAccess] PRIMARY KEY CLUSTERED ([ReportingUserAccessID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportingUserAccess] ADD CONSTRAINT [IX_ReportingUserAccess_UserID] UNIQUE NONCLUSTERED ([UserID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportingUserAccess] ADD CONSTRAINT [FK_ReportingUserAccess_ReportingUserFID] FOREIGN KEY ([ReportingUserFID]) REFERENCES [dbo].[ReportingUser] ([ReportingUserID])
GO
GRANT SELECT ON [dbo].[ReportingUserAccess] TO [MssExec]
GRANT INSERT ON [dbo].[ReportingUserAccess] TO [MssExec]
GRANT DELETE ON [dbo].[ReportingUserAccess] TO [MssExec]
GRANT UPDATE ON [dbo].[ReportingUserAccess] TO [MssExec]
GO