/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
/** 新增通用语言字段 **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CMPLRS' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_MRP_CMPLRS ADD (FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_GROSSDEMAND_DEFINE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_MRP_GROSSDEMAND_DEFINE ADD (FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_GROSSDEMAND_DEFINE' AND KSQL_COL_NAME ='FMRPSUPPLYTYPE') 
 ALTER TABLE T_MRP_GROSSDEMAND_DEFINE ADD (FMRPSUPPLYTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL );
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_GROSSDEMAND_DEFINE' AND KSQL_COL_NAME ='FMRPDEMANDTYPE') 
 ALTER TABLE T_MRP_GROSSDEMAND_DEFINE ADD (FMRPDEMANDTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL );
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_GROSSDEMAND_DEFINE' AND KSQL_COL_NAME ='FSUPPLYSLUGGISHTYPE') 
 ALTER TABLE T_MRP_GROSSDEMAND_DEFINE ADD (FSUPPLYSLUGGISHTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL );
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_GROSSDEMAND_DEFINE' AND KSQL_COL_NAME ='FSAFETYSTOCK') 
 ALTER TABLE T_MRP_GROSSDEMAND_DEFINE ADD (FSAFETYSTOCK NVARCHAR(50) DEFAULT ' ' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_RUNCONFIG' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_MRP_RUNCONFIG ADD (FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL );
 

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
