/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT' AND KSQL_COL_NAME IN ('FSYSTYPE')) 
 ALTER TABLE T_SRC_PROJECT ADD (FSYSTYPE CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCORE' AND KSQL_COL_NAME IN ('FAPTITUDERESULT')) 
 ALTER TABLE T_SRC_SCORE ADD (FAPTITUDERESULT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCORE' AND KSQL_COL_NAME IN ('FAPTITUDENOTE')) 
 ALTER TABLE T_SRC_SCORE ADD (FAPTITUDENOTE NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCORE' AND KSQL_COL_NAME IN ('FISPURAPTITUDE')) 
 ALTER TABLE T_SRC_SCORE ADD (FISPURAPTITUDE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCORE' AND KSQL_COL_NAME IN ('FSUPPLIERIP')) 
 ALTER TABLE T_SRC_SCORE ADD (FSUPPLIERIP VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCORE' AND KSQL_COL_NAME IN ('FCFMSTATUS')) 
 ALTER TABLE T_SRC_SCORE ADD (FCFMSTATUS CHAR(1) DEFAULT 'A' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCORE' AND KSQL_COL_NAME IN ('FISAPTITUDEREPLY')) 
 ALTER TABLE T_SRC_SCORE ADD (FISAPTITUDEREPLY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_TIMECHG' AND KSQL_COL_NAME IN ('FAPTITUDEDATE')) 
 ALTER TABLE T_SRC_TIMECHG ADD (FAPTITUDEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_TIMECHG' AND KSQL_COL_NAME IN ('FNEWAPTITUDEDATE')) 
 ALTER TABLE T_SRC_TIMECHG ADD (FNEWAPTITUDEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCOREENTRY' AND KSQL_COL_NAME IN ('FAPTITUDEREPLY')) 
 ALTER TABLE T_SRC_SCOREENTRY ADD (FAPTITUDEREPLY NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_R' AND KSQL_COL_NAME IN ('FAPTITUDEDATE')) 
 ALTER TABLE T_SRC_PROJECT_R ADD (FAPTITUDEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_ENROLLSUPPLIER' AND KSQL_COL_NAME IN ('FISAPTITUDEREPLY')) 
 ALTER TABLE T_SRC_ENROLLSUPPLIER ADD (FISAPTITUDEREPLY 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 ('FISAPTITUDEREPLY')) 
 ALTER TABLE T_SRC_INVITESUPPLIER ADD (FISAPTITUDEREPLY 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 ('FISPURAPTITUDE')) 
 ALTER TABLE T_SRC_INVITESUPPLIER ADD (FISPURAPTITUDE 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 ('FISAPTITUDEREPLY')) 
 ALTER TABLE T_SRC_INVITESUPPLIER_TEMP ADD (FISAPTITUDEREPLY 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 ('FISPURAPTITUDE')) 
 ALTER TABLE T_SRC_INVITESUPPLIER_TEMP ADD (FISPURAPTITUDE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_EXT' AND KSQL_COL_NAME IN ('FSYSTYPE')) 
 ALTER TABLE T_SRC_PROJECT_EXT ADD (FSYSTYPE CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMANDSUPPLIER' AND KSQL_COL_NAME IN ('FISPURAPTITUDE')) 
 ALTER TABLE T_SRC_DEMANDSUPPLIER ADD (FISPURAPTITUDE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DECISIONSUMSUP2' AND KSQL_COL_NAME IN ('FPACKAGENAME')) 
 ALTER TABLE T_SRC_DECISIONSUMSUP2 ADD (FPACKAGENAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_APPLYSUPPLIER' AND KSQL_COL_NAME IN ('FISPURAPTITUDE')) 
 ALTER TABLE T_SRC_APPLYSUPPLIER ADD (FISPURAPTITUDE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_APTITUDEREPLY_FJ') 
 CREATE TABLE T_SRC_APTITUDEREPLY_FJ (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);



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