/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FMM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PDM_MFTBOM' AND KSQL_COL_NAME ='FOPTIONCONTROL') 
 ALTER TABLE T_PDM_MFTBOM ADD (FOPTIONCONTROL NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PDM_MFTBOMENTRY' AND KSQL_COL_NAME ='FFEATURETYPE') 
 ALTER TABLE T_PDM_MFTBOMENTRY ADD (FFEATURETYPE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PDM_MFTBOMENTRY' AND KSQL_COL_NAME ='FQTYOPT') 
 ALTER TABLE T_PDM_MFTBOMENTRY ADD (FQTYOPT CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PDM_MFTBOMENTRY' AND KSQL_COL_NAME ='FOPT') 
 ALTER TABLE T_PDM_MFTBOMENTRY ADD (FOPT CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PDM_MFTBOMENTRY' AND KSQL_COL_NAME ='FPREFEROPT') 
 ALTER TABLE T_PDM_MFTBOMENTRY ADD (FPREFEROPT CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PDM_MFTBOMENTRY' AND KSQL_COL_NAME ='FMUTUEXCOPT') 
 ALTER TABLE T_PDM_MFTBOMENTRY ADD (FMUTUEXCOPT CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PDM_MFTBOMENTRY' AND KSQL_COL_NAME ='FMINQTY') 
 ALTER TABLE T_PDM_MFTBOMENTRY ADD (FMINQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PDM_MFTBOMENTRY' AND KSQL_COL_NAME ='FMAXQTY') 
 ALTER TABLE T_PDM_MFTBOMENTRY ADD (FMAXQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PDM_MFTBOMENTRY' AND KSQL_COL_NAME ='FENTRYSEQ') 
 ALTER TABLE T_PDM_MFTBOMENTRY ADD (FENTRYSEQ BIGINT DEFAULT 0 NOT NULL );

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