/**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_SIMULATIONOUTLINE' AND KSQL_COL_NAME ='FREQUIRETYPEID') 
 ALTER TABLE T_MRP_SIMULATIONOUTLINE ADD (FREQUIRETYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATIONOUTLINE' AND KSQL_COL_NAME ='FBILLID') 
 ALTER TABLE T_MRP_SIMULATIONOUTLINE ADD (FBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATIONOUTLINE' AND KSQL_COL_NAME ='FBILLENTRYID') 
 ALTER TABLE T_MRP_SIMULATIONOUTLINE ADD (FBILLENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATIONOUTLINE' AND KSQL_COL_NAME ='FBILLENTRYKEY') 
 ALTER TABLE T_MRP_SIMULATIONOUTLINE ADD (FBILLENTRYKEY NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATIONOUTLINE' AND KSQL_COL_NAME ='FBILLTYPEID') 
 ALTER TABLE T_MRP_SIMULATIONOUTLINE ADD (FBILLTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATIONOUTLINE' AND KSQL_COL_NAME ='FDEMANDBILLID') 
 ALTER TABLE T_MRP_SIMULATIONOUTLINE ADD (FDEMANDBILLID NVARCHAR(50) DEFAULT ' ' NOT NULL );
 --- drop column --------- 不允许删除表T_MRP_SIMULATIONOUTLINE的字段FREQUIRETYPE，请恢复pdm中的字段 ------------------- 
 --- drop column --------- 不允许删除表T_MRP_SIMULATIONOUTLINE的字段FBILLTYPE，请恢复pdm中的字段 ------------------- 

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