
[dbo].[harstateprocessaccess]
CREATE TABLE [dbo].[harstateprocessaccess]
(
[stateobjid] [int] NOT NULL,
[processobjid] [int] NOT NULL,
[usrgrpobjid] [int] NOT NULL,
[executeaccess] [char] (1) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL CONSTRAINT [DF__harstatep__execu__3C5FD9F8] DEFAULT ('N')
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[harstateprocessaccess] ADD CONSTRAINT [XPKharstateprocessaccess] PRIMARY KEY CLUSTERED ([stateobjid], [processobjid], [usrgrpobjid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[harstateprocessaccess] ADD CONSTRAINT [HARSTATEPROCACCESS_SPID_FK] FOREIGN KEY ([stateobjid], [processobjid]) REFERENCES [dbo].[harstateprocess] ([stateobjid], [processobjid]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[harstateprocessaccess] ADD CONSTRAINT [HARSTATEPROCACCESS_USRGRP_FK] FOREIGN KEY ([usrgrpobjid]) REFERENCES [dbo].[harusergroup] ([usrgrpobjid]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[harstateprocessaccess] TO [harvest_group]
GRANT INSERT ON [dbo].[harstateprocessaccess] TO [harvest_group]
GRANT DELETE ON [dbo].[harstateprocessaccess] TO [harvest_group]
GRANT UPDATE ON [dbo].[harstateprocessaccess] TO [harvest_group]
GRANT SELECT ON [dbo].[harstateprocessaccess] TO [harvest_rep]
GO