--委外领料分录
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_MDC_OMOUTBILLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL);

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_MDC_OMOUTBILLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL);
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDCOM_MQBENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_MDCOM_MQBENTRY ADD (FNOUPDATEINVFIELDS NVARCHAR(255) DEFAULT ' ' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_MDC_OMOUTBILLENTRY ADD (FNOUPDATEINVFIELDS NVARCHAR(255) DEFAULT ' ' NOT NULL );