IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CONVERTDIFFENTITY' AND KSQL_COL_NAME ='FCHFORMULA') 
 ALTER TABLE T_BCM_CONVERTDIFFENTITY ADD (FCHFORMULA NVARCHAR(255) );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CONVERTDIFFENTITY' AND KSQL_COL_NAME ='FSCOPETXT') 
 ALTER TABLE T_BCM_CONVERTDIFFENTITY ADD (FSCOPETXT NVARCHAR(255) );

/** 折算差历史数据处理 **/ 
UPDATE T_BCM_CONVERTDIFFENTITY SET FCHFORMULA=LEFT(FCHINESEFORMULA,255), FSCOPETXT=LEFT(FRANGETXT,255);
