CREATE TABLE [dbo].[FuelCost]
(
[FuelCostID] [int] NOT NULL IDENTITY(1, 1),
[LoadFromDate] [datetime] NULL,
[LoadToDate] [datetime] NULL,
[FuelPrice] [decimal] (12, 3) NOT NULL,
[DateEntered] [datetime] NOT NULL,
[EnteredBy] [int] NOT NULL,
[DateModified] [datetime] NULL,
[ModifiedBy] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FuelCost] ADD CONSTRAINT [CK_FuelCost_LoadFromLoadToDate] CHECK ((isnull([LoadFromDate],(0))<isnull([LoadToDate],(100000)) AND (1)=[dbo].[ValidFuelCostLoadDateRange]([LoadFromDate],[LoadToDate])))
GO
ALTER TABLE [dbo].[FuelCost] ADD CONSTRAINT [PK_FuelCost] PRIMARY KEY CLUSTERED ([FuelCostID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FuelCost] ADD CONSTRAINT [FK_FuelCostEntered_Sysuser] FOREIGN KEY ([EnteredBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[FuelCost] ADD CONSTRAINT [FK_FuelCostModified_Sysuser] FOREIGN KEY ([ModifiedBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[FuelCost] TO [MssExec]
GRANT INSERT ON [dbo].[FuelCost] TO [MssExec]
GRANT DELETE ON [dbo].[FuelCost] TO [MssExec]
GRANT UPDATE ON [dbo].[FuelCost] TO [MssExec]
GO