/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUEST_A' AND KSQL_COL_NAME ='FECSOURCE') 
 ALTER TABLE T_PUR_REQUEST_A ADD (FECSOURCE NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUEST' AND KSQL_COL_NAME ='FADMINDIVISION') 
 ALTER TABLE T_PUR_REQUEST ADD (FADMINDIVISION BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUEST' AND KSQL_COL_NAME ='FCARDNUMBER') 
 ALTER TABLE T_PUR_REQUEST ADD (FCARDNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUEST' AND KSQL_COL_NAME ='FBANK') 
 ALTER TABLE T_PUR_REQUEST ADD (FBANK NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUEST' AND KSQL_COL_NAME ='FCARDUSERNAME') 
 ALTER TABLE T_PUR_REQUEST ADD (FCARDUSERNAME NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUESTENTRY_A' AND KSQL_COL_NAME ='FRETREASONCODE') 
 ALTER TABLE T_PUR_REQUESTENTRY_A ADD (FRETREASONCODE VARCHAR(10) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUESTENTRY_A' AND KSQL_COL_NAME ='FSERVICETIME') 
 ALTER TABLE T_PUR_REQUESTENTRY_A ADD (FSERVICETIME VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_REQUESTENTRY_A' AND KSQL_COL_NAME ='FECORDER') 
 ALTER TABLE T_PUR_REQUESTENTRY_A ADD (FECORDER BIGINT DEFAULT 0 NOT NULL );

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