CREATE TABLE [dbo].[GLSource]
(
[GLSPriKey] [int] NOT NULL IDENTITY(1, 1),
[SourceName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SourceTable] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SourceField] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SourceKeyFieldName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ParentKeyFieldName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NormalOrSub] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GLSource] ADD CONSTRAINT [CK_GLSource_SourceName] CHECK (([SourceName]='Sub' OR [SourceName]='Natural' OR [SourceName]='Division' OR [SourceName]='Branch' OR [SourceName]='Company'))
GO
ALTER TABLE [dbo].[GLSource] ADD CONSTRAINT [PK_GLSource] PRIMARY KEY CLUSTERED ([GLSPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GLSource] ADD CONSTRAINT [IX_GLSource_SourceName] UNIQUE NONCLUSTERED ([SourceName]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
GRANT SELECT ON [dbo].[GLSource] TO [MssExec]
GRANT INSERT ON [dbo].[GLSource] TO [MssExec]
GRANT DELETE ON [dbo].[GLSource] TO [MssExec]
GRANT UPDATE ON [dbo].[GLSource] TO [MssExec]
GO