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

EXEC p_AlterColumn 'T_MRP_INDEXCONFIG', 'FINDEX', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_PLANPROORGENTRY') 
 CREATE TABLE T_MRP_PLANPROORGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDEMANDORG BIGINT DEFAULT 0 NOT NULL,
FINVSTRATEGY BIGINT DEFAULT 0 NOT NULL,
FSUPPLYNET BIGINT DEFAULT 0 NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANPRODMENTRY' AND KSQL_COL_NAME ='FDETAILID') 
 ALTER TABLE T_MRP_PLANPRODMENTRY ADD (FDETAILID BIGINT DEFAULT 0 NOT NULL );



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