CREATE TABLE [dbo].[ICCommissions]
(
[ICCommPriKey] [int] NOT NULL IDENTITY(1, 1),
[LaborType] [int] NULL,
[CommGLAccount] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CommGLSubAccount] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ICDPriKey] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICCommissions] ADD CONSTRAINT [PK_ICCommissions] PRIMARY KEY CLUSTERED ([ICCommPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICCommissions] ADD CONSTRAINT [IX_ICCommissions_ICDetail_LaborType] UNIQUE NONCLUSTERED ([ICDPriKey], [LaborType]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICCommissions] ADD CONSTRAINT [FK_ICCommissions_ICDetail] FOREIGN KEY ([ICDPriKey]) REFERENCES [dbo].[ICDetail] ([ICDPriKey])
GO
ALTER TABLE [dbo].[ICCommissions] ADD CONSTRAINT [FK_ICCommissions_LaborType] FOREIGN KEY ([LaborType]) REFERENCES [dbo].[LaborType] ([PriKey])
GO
GRANT SELECT ON [dbo].[ICCommissions] TO [MssExec]
GRANT INSERT ON [dbo].[ICCommissions] TO [MssExec]
GRANT DELETE ON [dbo].[ICCommissions] TO [MssExec]
GRANT UPDATE ON [dbo].[ICCommissions] TO [MssExec]
GO