--委外完工入库
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMCPBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
ALTER TABLE T_IM_MDC_OMCPBILLENTRY ADD (FSERIALNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL);
--完工入库
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_PRBLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
ALTER TABLE T_IM_MDC_PRBLENTRY ADD (FSERIALNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL);
--简单委外入库
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMINBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
ALTER TABLE T_IM_MDC_OMINBILLENTRY ADD (FSERIALNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL);
--生产领料单  T_IM_MDC_MQBENTRY
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MQBENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
ALTER TABLE T_IM_MDC_MQBENTRY ADD (FSERIALNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL);
--简单委外领料单  T_IM_MDCOM_MQBENTRY
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDCOM_MQBENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
ALTER TABLE T_IM_MDCOM_MQBENTRY ADD (FSERIALNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL);
--委外领料单  T_IM_MDC_OMOUTBILLENTRY
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILLENTRY' AND KSQL_COL_NAME ='FSERIALNUMBER') 
ALTER TABLE T_IM_MDC_OMOUTBILLENTRY ADD (FSERIALNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL);