/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCORE' AND KSQL_COL_NAME IN ('FAGENTS')) 
 ALTER TABLE T_SRC_SCORE ADD (FAGENTS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCORE' AND KSQL_COL_NAME IN ('FCFMSTATUS_PUR')) 
ALTER TABLE T_SRC_SCORE ADD (FCFMSTATUS_PUR 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 ('FCFMSTATUS_SUP')) 
 ALTER TABLE T_SRC_SCORE ADD (FCFMSTATUS_SUP CHAR(1) DEFAULT 'A' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCOREENTRY' AND KSQL_COL_NAME IN ('FAPTITUDEREPLYVALUE')) 
 ALTER TABLE T_SRC_SCOREENTRY ADD (FAPTITUDEREPLYVALUE NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCOREENTRY' AND KSQL_COL_NAME IN ('FENTRYSTATUS')) 
 ALTER TABLE T_SRC_SCOREENTRY ADD (FENTRYSTATUS CHAR(1) DEFAULT 'A' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INDEX' AND KSQL_COL_NAME IN ('FVALUEBIZOBJECT')) 
 ALTER TABLE T_SRC_INDEX ADD (FVALUEBIZOBJECT VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INDEX' AND KSQL_COL_NAME IN ('FFIELDNAME')) 
 ALTER TABLE T_SRC_INDEX ADD (FFIELDNAME VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEMEINDEX' AND KSQL_COL_NAME IN ('FVALUEBIZOBJECT')) 
 ALTER TABLE T_SRC_SCHEMEINDEX ADD (FVALUEBIZOBJECT VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEMEINDEX' AND KSQL_COL_NAME IN ('FFIELDNAME')) 
 ALTER TABLE T_SRC_SCHEMEINDEX ADD (FFIELDNAME VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEMEINDEX' AND KSQL_COL_NAME IN ('FVALUETYPE')) 
 ALTER TABLE T_SRC_SCHEMEINDEX ADD (FVALUETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEMEINDEX' AND KSQL_COL_NAME IN ('FITEMTYPE')) 
 ALTER TABLE T_SRC_SCHEMEINDEX ADD (FITEMTYPE CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_ASSESSSCORER2') 
 CREATE TABLE T_SRC_ASSESSSCORER2 (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);



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