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

 EXEC p_AlterColumn 'T_PUR_REGSUPBANK', 'FACCOUNTNAME', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_USER_L', 'FENTERPRISE', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_REGSUPPLIER_L', 'FNAME', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_PUR_REGSUPPLIER_L', 'FSIMPLENAME', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPARENTRY_A' AND KSQL_COL_NAME IN ('FLASTCOMPAREID')) 
 ALTER TABLE T_PUR_COMPARENTRY_A ADD (FLASTCOMPAREID VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPARENTRY_A' AND KSQL_COL_NAME IN ('FLASTCOMPAREPRICE')) 
 ALTER TABLE T_PUR_COMPARENTRY_A ADD (FLASTCOMPAREPRICE DECIMAL(19,6) DEFAULT 0 NOT NULL );

 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER' AND KSQL_COL_NAME ='FCREATEORGID') 
 ALTER TABLE T_PUR_REGSUPPLIER ADD (FCREATEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REGSUPPLIER' AND KSQL_COL_NAME ='FCTRLSTRATEGY') 
 ALTER TABLE T_PUR_REGSUPPLIER ADD (FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL );
 
 
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_table.sql **/
