/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_DEPRESPLITDIMS') 
 CREATE TABLE T_FA_DEPRESPLITDIMS (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CHANGEBAK_FIN' AND KSQL_COL_NAME ='FNUMBER') 
 ALTER TABLE T_FA_CHANGEBAK_FIN ADD (FNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_WORKLOAD' AND KSQL_COL_NAME ='FDATE') 
 ALTER TABLE T_FA_WORKLOAD ADD (FDATE DATETIME );

 EXEC p_AlterColumn 'T_FA_WORKLOAD', 'FFATE', 'NULL', 'NULL', '1001', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CHANGERECORD' AND KSQL_COL_NAME ='FTRACEDATE') 
 ALTER TABLE T_FA_CHANGERECORD ADD (FTRACEDATE DATETIME );

 EXEC p_AlterColumn 'T_FA_CHANGERECORD', 'FTRACEPERIODID', 'NULL', 'NULL', '1001', 'NULL';


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
