 --领料分录
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MQBENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_MDC_MQBENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MQBENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_MDC_MQBENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MQBENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_MDC_MQBENTRY ADD (FNOUPDATEINVFIELDS NVARCHAR(255) DEFAULT ' ' NOT NULL );
 --完工入库分录
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_PRBLENTRY' AND KSQL_COL_NAME ='FTRACKNUMBERID') 
 ALTER TABLE T_IM_MDC_PRBLENTRY ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_PRBLENTRY' AND KSQL_COL_NAME ='FCONFIGUREDCODEID') 
 ALTER TABLE T_IM_MDC_PRBLENTRY ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_PRBLENTRY' AND KSQL_COL_NAME ='FNOUPDATEINVFIELDS') 
 ALTER TABLE T_IM_MDC_PRBLENTRY ADD (FNOUPDATEINVFIELDS NVARCHAR(255) DEFAULT ' ' NOT NULL );

 --差异分摊工单信息
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MFTBACKDIFSHARE' AND KSQL_COL_NAME ='FTRACKNUMBERID')
 ALTER TABLE T_IM_MDC_MFTBACKDIFSHARE ADD (FTRACKNUMBERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MFTBACKDIFSHARE' AND KSQL_COL_NAME ='FCONFIGUREDCODEID')
 ALTER TABLE T_IM_MDC_MFTBACKDIFSHARE ADD (FCONFIGUREDCODEID BIGINT DEFAULT 0 NOT NULL );

