create table Account_SubAccounts(
                  ASA_CustodianAcctNum varchar(20) Not Null,  
                  ASA_ClientAccountNumber varchar(20) Not Null,  
		  ASA_AcctID varchar(10) Not Null,  
                  ASA_Symbol  varchar(15) Null,    
                  ASA_SweepFund  varchar(15) Null, 
                  ASA_Description  varchar(50) Null,
		  ASA_LogInUserId  varchar(20) Null,
		  ASA_LogInPassWord varchar(20) Null,
		  ASA_TempRecord bit null default 0,
                  ASA_IsFrozen bit null default 0,
                  CONSTRAINT PK_Account_SubAccounts PRIMARY KEY CLUSTERED (ASA_CustodianAcctNum)
                  );

ALTER TABLE [dbo].[Account_SubAccounts] ADD 
	CONSTRAINT [FK_Account_SubAccounts_Account_Details] FOREIGN KEY 
	(
		[ASA_ClientAccountNumber]
	) REFERENCES [dbo].[Account_Details] (
		[ADT_ClientAccountNumber]
	) ON DELETE CASCADE  ON UPDATE CASCADE
