[dbo].[PersonnelDocumentTypeUserMap]
CREATE TABLE [dbo].[PersonnelDocumentTypeUserMap]
(
[PersonnelDocumentTypeUserMapID] [int] NOT NULL IDENTITY(1, 1),
[SysUserFID] [int] NOT NULL,
[PersonnelDocumentTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PersonnelDocumentTypeUserMap] ADD CONSTRAINT [PK_PersonnelDocumentTypeUserMap] PRIMARY KEY CLUSTERED ([PersonnelDocumentTypeUserMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PersonnelDocumentTypeUserMap] ADD CONSTRAINT [IX_PersonnelDocumentType_SysUserFID_PersonnelDocumentTypeFID] UNIQUE NONCLUSTERED ([SysUserFID], [PersonnelDocumentTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PersonnelDocumentTypeUserMap] ADD CONSTRAINT [FK_PersonnelDocumentTypeUserMap_PersonnelDocumentType] FOREIGN KEY ([PersonnelDocumentTypeFID]) REFERENCES [dbo].[PersonnelDocumentType] ([PersonnelDocumentTypeID])
GO
ALTER TABLE [dbo].[PersonnelDocumentTypeUserMap] ADD CONSTRAINT [FK_PersonnelDocumentTypeUserMap_SysUser] FOREIGN KEY ([SysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[PersonnelDocumentTypeUserMap] TO [MssExec]
GRANT INSERT ON [dbo].[PersonnelDocumentTypeUserMap] TO [MssExec]
GRANT DELETE ON [dbo].[PersonnelDocumentTypeUserMap] TO [MssExec]
GRANT UPDATE ON [dbo].[PersonnelDocumentTypeUserMap] TO [MssExec]
GO