CREATE TABLE [dbo].[FactoringBatch]
(
[FactoringBatchID] [int] NOT NULL IDENTITY(1, 1),
[CreatedBy] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL CONSTRAINT [DF_FactoringBatch_CreatedDate] DEFAULT (getdate()),
[ControlNumber] [bigint] NULL,
[BatchTotal] [money] NOT NULL,
[FolderName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FactoringBatch] ADD CONSTRAINT [PK_FactoringBatch] PRIMARY KEY NONCLUSTERED ([FactoringBatchID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FactoringBatch] ADD CONSTRAINT [FK_FactoringBatch_CreatedBy] FOREIGN KEY ([CreatedBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[FactoringBatch] TO [MssExec]
GRANT INSERT ON [dbo].[FactoringBatch] TO [MssExec]
GRANT DELETE ON [dbo].[FactoringBatch] TO [MssExec]
GRANT UPDATE ON [dbo].[FactoringBatch] TO [MssExec]
GO