CREATE TABLE [dbo].[PMImportHeader]
(
[PMImportHeaderID] [int] NOT NULL IDENTITY(1, 1),
[XmlInterfaceFID] [int] NOT NULL,
[Description] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[JournalDate] [datetime] NULL,
[Amount] [money] NULL,
[AgentFID] [int] NULL,
[BranchFID] [int] NULL,
[IsCRBatch] [smallint] NULL,
[Filename] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FilePath] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsVanLineStatement] [bit] NOT NULL CONSTRAINT [DF_PMImportHeader_IsVanLineStatement] DEFAULT ((0)),
[AutoApplyFlag] [bit] NOT NULL CONSTRAINT [DF_PMImportHEader_AutoApplyFlag] DEFAULT ((0)),
[VanlineGroupExternalCode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PMImportHeader] ADD CONSTRAINT [PK_PMImportHeader] PRIMARY KEY CLUSTERED ([PMImportHeaderID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PMImportHeader] ADD CONSTRAINT [FK_PMImportHeader_Agent] FOREIGN KEY ([AgentFID]) REFERENCES [dbo].[Agent] ([AgentPriKey])
GO
ALTER TABLE [dbo].[PMImportHeader] ADD CONSTRAINT [FK_PMImportHeader_Branch] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[PMImportHeader] ADD CONSTRAINT [FK_PMImportHeader_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID])
GO
GRANT SELECT ON [dbo].[PMImportHeader] TO [MssExec]
GRANT INSERT ON [dbo].[PMImportHeader] TO [MssExec]
GRANT DELETE ON [dbo].[PMImportHeader] TO [MssExec]
GRANT UPDATE ON [dbo].[PMImportHeader] TO [MssExec]
GO