CREATE TABLE [dbo].[ICCostPoolItems]
(
[CostPoolID] [int] NOT NULL,
[ItemID] [int] NOT NULL,
[OnHandQty] [decimal] (18, 6) NOT NULL CONSTRAINT [DF_ICCostPoolItems_OnHandQty] DEFAULT ((0)),
[AvgCost] [money] NOT NULL CONSTRAINT [DF_ICCostPoolItems_AvgCost] DEFAULT ((0)),
[OnHandCost] [money] NOT NULL CONSTRAINT [DF_ICCostPoolItems_OnHandCost] DEFAULT ((0)),
[CreatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[UpdatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_ICCostPoolItems_CreateDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_ICCostPoolItems_LastUpdate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICCostPoolItems] ADD CONSTRAINT [FK_ICCostPoolItems_CostPoolID_ICCostPools] FOREIGN KEY ([CostPoolID]) REFERENCES [dbo].[ICCostPools] ([CostPoolID])
GO
ALTER TABLE [dbo].[ICCostPoolItems] ADD CONSTRAINT [FK_ICCostPoolItems_ItemID_ICItems] FOREIGN KEY ([ItemID]) REFERENCES [dbo].[ICItems] ([ItemID])
GO