/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_QUOTEBILL' AND KSQL_COL_NAME IN ('FISPURAGENT')) 
 ALTER TABLE T_SRC_QUOTEBILL ADD (FISPURAGENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDDOCBILL' AND KSQL_COL_NAME IN ('FISPURAGENT')) 
 ALTER TABLE T_SRC_BIDDOCBILL ADD (FISPURAGENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER' AND KSQL_COL_NAME IN ('FISPURAGENT')) 
 ALTER TABLE T_SRC_INVITESUPPLIER ADD (FISPURAGENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER_TEMP' AND KSQL_COL_NAME IN ('FISPURAGENT')) 
 ALTER TABLE T_SRC_INVITESUPPLIER_TEMP ADD (FISPURAGENT CHAR(1) DEFAULT '0' NOT NULL );
 EXEC p_AlterColumn 'T_SRC_PATTERN', 'FSCOREPARA', 'DECIMAL(19,6)', 'NOT NULL', '0001', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PATTERN' AND KSQL_COL_NAME IN ('FSUPPLIERNUM')) 
 ALTER TABLE T_SRC_PATTERN ADD (FSUPPLIERNUM INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PATTERN' AND KSQL_COL_NAME IN ('FISNONNEGATIVE')) 
 ALTER TABLE T_SRC_PATTERN ADD (FISNONNEGATIVE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PATTERN' AND KSQL_COL_NAME IN ('FSUPPLIERNUM2')) 
 ALTER TABLE T_SRC_PATTERN ADD (FSUPPLIERNUM2 INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PATTERN' AND KSQL_COL_NAME IN ('FSCOREPARA2')) 
 ALTER TABLE T_SRC_PATTERN ADD (FSCOREPARA2 DECIMAL(23,10) DEFAULT 2 NOT NULL );

/**End C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
