[dbo].[ItemCodeVanLineMapping]
CREATE TABLE [dbo].[ItemCodeVanLineMapping]
(
[ItemCodeVanLineMappingID] [int] NOT NULL IDENTITY(1, 1),
[ItemCodeFID] [int] NOT NULL,
[VanlineGroupFID] [int] NOT NULL,
[VanlineServiceCode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[VanlineCartonCode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VanlineDescription] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ItemCodeVanLineMapping] ADD CONSTRAINT [PK_ItemCodeVanLineMapping] PRIMARY KEY NONCLUSTERED ([ItemCodeVanLineMappingID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ItemCodeVanLineMapping_ItemVLGroupServiceCarton] ON [dbo].[ItemCodeVanLineMapping] ([ItemCodeFID], [VanlineGroupFID], [VanlineServiceCode], [VanlineCartonCode]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ItemCodeVanLineMapping_VLGroupServiceCarton] ON [dbo].[ItemCodeVanLineMapping] ([VanlineGroupFID], [VanlineServiceCode], [VanlineCartonCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ItemCodeVanLineMapping] ADD CONSTRAINT [FK_ItemCodeVanLineMapping_ItemCode] FOREIGN KEY ([ItemCodeFID]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
ALTER TABLE [dbo].[ItemCodeVanLineMapping] ADD CONSTRAINT [FK_ItemCodeVanLineMapping_VanlineGroup] FOREIGN KEY ([VanlineGroupFID]) REFERENCES [dbo].[VanlineGroup] ([VanlineGroupID])
GO
GRANT SELECT ON [dbo].[ItemCodeVanLineMapping] TO [MssExec]
GRANT INSERT ON [dbo].[ItemCodeVanLineMapping] TO [MssExec]
GRANT DELETE ON [dbo].[ItemCodeVanLineMapping] TO [MssExec]
GRANT UPDATE ON [dbo].[ItemCodeVanLineMapping] TO [MssExec]
GO