/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_table.sql **/
 EXEC p_AlterColumn 'T_PUR_REGSUPINDEX', 'FYEAR', 'NVARCHAR(10)', 'NOT NULL', '1111', ''' ''';

 EXEC p_AlterColumn 'T_PUR_REGSUPINDEX', 'FUNIT', 'NVARCHAR(10)', 'NOT NULL', '1111', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKORDER' AND KSQL_COL_NAME ='FINVOICESTATE') 
 ALTER TABLE T_PUR_THIRDCHECKORDER ADD (FINVOICESTATE NVARCHAR(10) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDDATAENTRY' AND KSQL_COL_NAME ='FCHECKSTATUS') 
 ALTER TABLE T_PUR_THIRDDATAENTRY ADD (FCHECKSTATUS CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDDATAENTRY' AND KSQL_COL_NAME ='FPLATFORM') 
 ALTER TABLE T_PUR_THIRDDATAENTRY ADD (FPLATFORM NVARCHAR(10) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDERENTRY_A' AND KSQL_COL_NAME ='FROWCLOSEREASON') 
 ALTER TABLE T_PUR_ORDERENTRY_A ADD (FROWCLOSEREASON NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDERENTRY_A' AND KSQL_COL_NAME ='FROWCLOSEDATE') 
 ALTER TABLE T_PUR_ORDERENTRY_A ADD (FROWCLOSEDATE DATETIME );

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