/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
 EXEC p_AlterColumn 'T_MRP_CALDETAILENTRY', 'FDEMANDBILLTYPE', 'NVARCHAR(50)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_MRP_CALDETAILENTRY', 'FSUPPLYBILLTYPE', 'NVARCHAR(50)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_MRP_CALDETAILENTRY', 'FADJUSTSUGGEST', 'NVARCHAR(50)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_MRP_CALDETAILENTRY', 'FMATERIALATTR', 'NVARCHAR(50)', 'NOT NULL', '1111', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FISMERGE') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FISMERGE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FMERGEBILLNO') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FMERGEBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FMERGEBILLID') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FMERGEBILLID NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FMERGEBILLENTRYID') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FMERGEBILLENTRYID NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FMERGEBILLENTRYSEQ') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FMERGEBILLENTRYSEQ INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FSRCDEMANDQTY') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FSRCDEMANDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_CALDETAILENTRY' AND KSQL_COL_NAME ='FISHANDLE') 
 ALTER TABLE T_MRP_CALDETAILENTRY ADD (FISHANDLE CHAR(1) DEFAULT '0' NOT NULL );

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