Create Table Account_Allocation(
                        AAL_Sequence integer Identity(1,1) NOT NULL,
  		        AAL_RepId VarChar(20) Not Null,
			AAL_AllocationDate datetime Not Null,
			AAL_InvestmentStyle varchar(20) Not Null,
			AAL_Symbol varchar(15) Not Null,
			AAL_SecType varchar(4) Null,
            	        AAL_SecGroup varchar(8) Null,
                        AAL_SecClass varchar(8) Null,
                        AAL_SecStyle varchar(8) Null,
                        AAL_SecCurrency varchar(4) Null,
			AAL_AllocationPct real Null,
                        AAL_MinValue money Null,
                        AAL_MinBuyAmount money Null,
                        AAL_MinSellAmount money Null,
                        AAL_MinQuantity float Null,
                        AAL_MinPlusPct real Null,
                        AAL_MinMinusPct real Null,
			AAL_MinHoldPeriod tinyint Null,
                        AAL_AllocationPrice float Null,
		        AAL_AllocationXrate real Null default 1,
                        AAL_BuySellSpec tinyint Null,
			AAL_ByTypeFlag bit null default 0,
                        AAL_ByGroupFlag bit null default 0,
	                AAL_ByClassFlag bit null default 0,
			AAL_BySecStyleFlag bit null default 0,
                        AAL_ByCurrencyFlag bit null default 0,
                        AAL_ByTaxIDFlag bit null default 0,
                        AAL_ByFamilyFlag bit null default 0,
                        AAL_ByClientGroupFlag bit null default 0,
                        AAL_ByAccountGroupFlag bit null default 0,
                        AAL_TaxQualifiedOnlyFlag bit null default 0,
			AAL_TempRecord bit null default 0,
                        AAL_IsFrozen bit null default 0,
                        CONSTRAINT PK_Account_Allocation PRIMARY KEY CLUSTERED (AAL_Sequence)
                            );

ALTER TABLE [dbo].[Account_Allocation] ADD
	CONSTRAINT [FK_Account_Allocation_General_UserInfo] FOREIGN KEY
	(
		[AAL_RepId]
	) REFERENCES [dbo].[General_UserInfo] (
		[CUC_LoginName]
	) ON UPDATE CASCADE

CREATE NONCLUSTERED INDEX Account_AllocationIndex
  ON Account_Allocation (AAL_RepId,AAL_AllocationDate,AAL_InvestmentStyle,AAL_Symbol);