CREATE TABLE [dbo].[AddlCharges]
(
[AddlChargesID] [int] NOT NULL IDENTITY(1, 1),
[ChargeAmount] [money] NULL,
[ChargeTypeID] [int] NULL,
[OrdPriKey] [int] NULL,
[JobsID] [int] NULL,
[BillToID] [int] NULL,
[PONo] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AuthorizedBy] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AuthViaID] [int] NULL,
[ChargeToOrder] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BillTrans] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Invoiced] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddlCharges] ADD CONSTRAINT [PK_AddlCharges] PRIMARY KEY NONCLUSTERED ([AddlChargesID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddlCharges] ADD CONSTRAINT [FK_AddlCharges_AuthVia] FOREIGN KEY ([AuthViaID]) REFERENCES [dbo].[AuthVia] ([AuthViaID])
GO
ALTER TABLE [dbo].[AddlCharges] ADD CONSTRAINT [FK_AddlCharges_BillChargesTo] FOREIGN KEY ([BillToID]) REFERENCES [dbo].[BillChargesTo] ([BillChargesToID])
GO
ALTER TABLE [dbo].[AddlCharges] ADD CONSTRAINT [FK_AddlCharges_ChargeTypes] FOREIGN KEY ([ChargeTypeID]) REFERENCES [dbo].[ChargeTypes] ([ChargeTypeID])
GO
ALTER TABLE [dbo].[AddlCharges] ADD CONSTRAINT [FK_AddlCharges_Jobs] FOREIGN KEY ([JobsID]) REFERENCES [dbo].[Jobs] ([JobsID])
GO
ALTER TABLE [dbo].[AddlCharges] ADD CONSTRAINT [FK_AddlCharges_ORDERS] FOREIGN KEY ([OrdPriKey]) REFERENCES [dbo].[Orders] ([PriKey])
GO
GRANT SELECT ON [dbo].[AddlCharges] TO [MssExec]
GRANT INSERT ON [dbo].[AddlCharges] TO [MssExec]
GRANT DELETE ON [dbo].[AddlCharges] TO [MssExec]
GRANT UPDATE ON [dbo].[AddlCharges] TO [MssExec]
GO