Create Table Portfolio_Transactions(
                                   PTR_Sequence integer Identity(1,1) NOT NULL,
                                   PTR_ClientAccountNumber varchar(20)  NOT NULL,
				   PTR_Date datetime NOT NULL,
				   PTR_Symbol varchar(15) Null,
				   PTR_AcctID varchar(10) Null,
				   PTR_CashMargin varchar(1) Null,
                                   PTR_Strategy varchar(1) Null,
				   PTR_TAC varchar(3) NOT NULL,
				   PTR_Lot smallint Null,
				   PTR_Description varchar(320) Null,
				   PTR_Quantity float Null,
				   PTR_TradePrc float Null,
                                   PTR_PriceFactor float Null default 1,
				   PTR_Commission money Null,
 				   PTR_TradeFees money Null,
				   PTR_AccruedInt money Null,
				   PTR_LocalAmt money Null,
				   PTR_TaxWithheld money Null,
				   PTR_XRate float Null default 1,
				   PTR_Amount money Null,
				   PTR_EstTaxes money Null,
				   PTR_ShareBalance float Null,
				   PTR_CashBalance money Null,
				   PTR_AuxDate datetime Null,
				   PTR_AuxBase money Null,
                                   PTR_HoldPeriod smallint Null,
				   PTR_WashSaleId tinyint Null,
				   PTR_SettleDays tinyint Null,
                                   PTR_AuxXRate float null,
                                   PTR_CommissionLocal bit null default 0,
                                   PTR_TradeFeesLocal bit null default 0,
                                   PTR_AccruedIntLocal bit null default 0,
                                   PTR_TaxWithheldLocal bit null default 0,
                 		   PTR_AuxAmountLocal bit null default 0,
                                   PTR_TaxWHinEstTax bit null default 0,
                                   PTR_IsShort bit null default 0,
				   PTR_NoQtyCalc bit null default 0,
				   PTR_NoCommisCalc bit null default 0,
				   PTR_NoTrFeeCalc bit null default 0,
				   PTR_NoAcrIntCalc bit null default 0,
                                   PTR_NoAmtCalc bit null default 0,
  				   PTR_Reversal bit null default 0,
  				   PTR_IsDuplicate bit null default 0,
                                   PTR_IsinDLVRCVPair bit null default 0,
  				   PTR_Perturbed bit null default 0,
                                   PTR_ProgCtrlBits integer null default 0,
  	                           PTR_TempRecord bit null default 0,
                                   PTR_TaxBits tinyint Null default 0, 
                                   PTR_IsFrozen bit null default 0,
		      		   PTR_TradeId tinyint null,
                                   PTR_TradeCounterParty varchar(4) null,
                                   PTR_MiscStatus integer Null,
                                   PTR_TransCurrency varchar(4) null,
                                   PTR_LocalCashBal money null,
                                   PTR_ImportSource varchar(8) null,				   
                                    CONSTRAINT PK_Portfolio_Transactions PRIMARY KEY CLUSTERED (PTR_Sequence)
                                  );


ALTER TABLE [dbo].[Portfolio_Transactions] ADD
	CONSTRAINT [FK_Portfolio_Transactions_Account_Details] FOREIGN KEY
	(
		[PTR_ClientAccountNumber]
	) REFERENCES [dbo].[Account_Details] (
		[ADT_ClientAccountNumber]
	) ON DELETE CASCADE  ON UPDATE CASCADE
