CREATE TABLE [dbo].[GLAccountCustomProperties]
(
[AccountCustomPropertyID] [int] NOT NULL IDENTITY(1, 1),
[AccountID] [int] NOT NULL,
[ShAttributeID] [int] NOT NULL,
[IDVal] [int] NULL,
[TextVal] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Required] [bit] NOT NULL CONSTRAINT [DF_GLAccountCustomProperties_Required] DEFAULT ((0)),
[CreatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_GLAccountCustomProperties_CreateDate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GLAccountCustomProperties] ADD CONSTRAINT [PK_GLAccountCustomProperties] PRIMARY KEY CLUSTERED ([AccountCustomPropertyID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GLAccountCustomProperties] ADD CONSTRAINT [FK_GLAccountCustomProperties_AccountID_GLAccounts] FOREIGN KEY ([AccountID]) REFERENCES [dbo].[GLAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[GLAccountCustomProperties] ADD CONSTRAINT [FK_GLAccountCustomProperties_ShAttributeID_ShAttributes] FOREIGN KEY ([ShAttributeID]) REFERENCES [dbo].[ShAttributes] ([ShAttributeID])
GO