/**增加系统来源字段***/


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REIMBURSELEVEL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_REIMBURSELEVEL ADD (FMIGSRC INT DEFAULT 0 NOT NULL );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REIMBURSEBILL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_REIMBURSEBILL ADD (FMIGSRC INT DEFAULT 0 NOT NULL );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPAREA' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_TRIPAREA ADD (FMIGSRC INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REQBILL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_REQBILL ADD (FMIGSRC INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMBILL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_PUBREIMBILL ADD (FMIGSRC INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYREIMBURSEBILL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_DAILYREIMBURSEBILL ADD (FMIGSRC INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREBILL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_EXPENSESHAREBILL ADD (FMIGSRC INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYAPPLYBILL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_DAILYAPPLYBILL ADD (FMIGSRC INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYAPPLYBILL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_DAILYAPPLYBILL ADD (FMIGSRC INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYAPPLYBILL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_DAILYAPPLYBILL ADD (FMIGSRC INT DEFAULT 0 NOT NULL );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PAYEE' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_PAYEE ADD (FMIGSRC INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PREPAYBILL' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_PREPAYBILL    ADD (FMIGSRC INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPSTAND_ACCMOD' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_TRIPSTAND_ACCMOD ADD (FMIGSRC INT DEFAULT 0 NOT NULL );



/**差旅项目*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPEXPENSEITEM' AND KSQL_COL_NAME IN ('FMIGSRC'))
ALTER TABLE T_ER_TRIPEXPENSEITEM ADD (FMIGSRC INT DEFAULT 0 NOT NULL );





