/**Begin C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKENTRY' AND KSQL_COL_NAME IN ('FGOODSID')) 
 ALTER TABLE T_PUR_THIRDCHECKENTRY ADD (FGOODSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKENTRY' AND KSQL_COL_NAME IN ('FLINETYPEID')) 
 ALTER TABLE T_PUR_THIRDCHECKENTRY ADD (FLINETYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKENTRY' AND KSQL_COL_NAME IN ('FPURTYPEID')) 
 ALTER TABLE T_PUR_THIRDCHECKENTRY ADD (FPURTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKORDER' AND KSQL_COL_NAME IN ('FREQORGID')) 
 ALTER TABLE T_PUR_THIRDCHECKORDER ADD (FREQORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKORDER' AND KSQL_COL_NAME IN ('FRCVORGID')) 
 ALTER TABLE T_PUR_THIRDCHECKORDER ADD (FRCVORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKORDER' AND KSQL_COL_NAME IN ('FMALBILLNO')) 
 ALTER TABLE T_PUR_THIRDCHECKORDER ADD (FMALBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKORDER' AND KSQL_COL_NAME IN ('FREQPERSONID')) 
 ALTER TABLE T_PUR_THIRDCHECKORDER ADD (FREQPERSONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKORDER' AND KSQL_COL_NAME IN ('FRCVPERSONID')) 
 ALTER TABLE T_PUR_THIRDCHECKORDER ADD (FRCVPERSONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKORDER' AND KSQL_COL_NAME IN ('FPERSONID')) 
 ALTER TABLE T_PUR_THIRDCHECKORDER ADD (FPERSONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_THIRDCHECKORDER' AND KSQL_COL_NAME IN ('FBUSINESSTYPEID')) 
 ALTER TABLE T_PUR_THIRDCHECKORDER ADD (FBUSINESSTYPEID BIGINT DEFAULT 0 NOT NULL );

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