/**Begin C:\PDM_UPGRADE\PDM1\PDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PATTERNPARAMS' AND KSQL_COL_NAME IN ('FPARAMETERID')) 
 ALTER TABLE T_SRC_PATTERNPARAMS ADD (FPARAMETERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEMEPARAMS' AND KSQL_COL_NAME IN ('FPARAMETERID')) 
 ALTER TABLE T_SRC_SCHEMEPARAMS ADD (FPARAMETERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SUPSCHEMEPARAMS' AND KSQL_COL_NAME IN ('FPARAMETERID')) 
 ALTER TABLE T_SRC_SUPSCHEMEPARAMS ADD (FPARAMETERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPSCHEMEPARAMS' AND KSQL_COL_NAME IN ('FPARAMETERID')) 
 ALTER TABLE T_SRC_EXPSCHEMEPARAMS ADD (FPARAMETERID BIGINT DEFAULT 0 NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDCHANGE' AND KSQL_COL_NAME IN ('FSUPPLIERTYPE')) 
 ALTER TABLE T_SRC_BIDCHANGE ADD (FSUPPLIERTYPE VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDCHANGE' AND KSQL_COL_NAME IN ('FSUPPLIERID')) 
 ALTER TABLE T_SRC_BIDCHANGE ADD (FSUPPLIERID BIGINT DEFAULT 0 NOT NULL );
 EXEC p_AlterColumn 'T_SRC_QUESTIONSUPPLIER', 'FPKID', 'BIGINT', 'NOT NULL', '1111', '0';

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