/**Begin D:\PDM_UPGRADE\PDM1\HDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL' AND KSQL_COL_NAME IN ('FTRANSFEREFFECTSTATUS')) 
 ALTER TABLE T_HDM_TRANSFERBILL ADD (FTRANSFEREFFECTSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL' AND KSQL_COL_NAME IN ('FPOSTPATTERN')) 
 ALTER TABLE T_HDM_TRANSFERBILL ADD (FPOSTPATTERN VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_A' AND KSQL_COL_NAME IN ('FAREALITYDARKPOSITIONID')) 
 ALTER TABLE T_HDM_TRANSFERBILL_A ADD (FAREALITYDARKPOSITIONID BIGINT DEFAULT 0 NOT NULL );
 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FBCOMPANYHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FBORGHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FBPOSITIONHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FAPLANCOMPANYHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FAPLANORGHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FAPLANPOSITIONHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FACOMPANYHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FAORGHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FAPOSITIONHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FAREALITYCOMPANYHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 -------------------
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FAREALITYORGHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_A', 'FAREALITYPOSITIONHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_B', 'FBAFFILIATEORGHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop column --------- 请认真检查该脚本 ------------------- 
 EXEC p_AlterColumn 'T_HDM_TRANSFERBILL_B', 'FAAFFILIATEORGHISID', 'NULL', 'NULL', '1001', 'NULL';

 --- drop TABLE --------- 请认真检查该脚本 ------------------- 
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_TRANSFERBILL_C') 
 DROP TABLE T_HDM_TRANSFERBILL_C;


/**End D:\PDM_UPGRADE\PDM1\HDM_table.sql **/
