/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROCESSSEQENTRY' AND KSQL_COL_NAME ='FREFERENCE') 
 ALTER TABLE T_BD_PROCESSSEQENTRY ADD (FREFERENCE NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROCESSSEQENTRY' AND KSQL_COL_NAME ='FRELATION') 
 ALTER TABLE T_BD_PROCESSSEQENTRY ADD (FRELATION NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROCESSSEQENTRY' AND KSQL_COL_NAME ='FOUTPUT') 
 ALTER TABLE T_BD_PROCESSSEQENTRY ADD (FOUTPUT NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROCESSSEQENTRY' AND KSQL_COL_NAME ='FINPUT') 
 ALTER TABLE T_BD_PROCESSSEQENTRY ADD (FINPUT NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROCESSSEQENTRY' AND KSQL_COL_NAME ='FOPERATIONDESC') 
 ALTER TABLE T_BD_PROCESSSEQENTRY ADD (FOPERATIONDESC NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_ROUTER' AND KSQL_COL_NAME ='FMANUORGID') 
 ALTER TABLE T_BD_ROUTER ADD (FMANUORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_COSTBOM' AND KSQL_COL_NAME ='FMANUORGID') 
 ALTER TABLE T_BD_COSTBOM ADD (FMANUORGID BIGINT DEFAULT 0 NOT NULL );

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