/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLIST' AND KSQL_COL_NAME IN ('FISBIZITEMCOMP')) 
 ALTER TABLE T_SRC_PURLIST ADD (FISBIZITEMCOMP CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY' AND KSQL_COL_NAME IN ('FISBIZITEM')) 
 ALTER TABLE T_SRC_PURLISTENTRY ADD (FISBIZITEM CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY_A' AND KSQL_COL_NAME IN ('FITEMTYPE')) 
 ALTER TABLE T_SRC_PURLISTENTRY_A ADD (FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY_A' AND KSQL_COL_NAME IN ('FBIZITEMLD')) 
 ALTER TABLE T_SRC_PURLISTENTRY_A ADD (FBIZITEMLD BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY_A' AND KSQL_COL_NAME IN ('FREQUEST')) 
 ALTER TABLE T_SRC_PURLISTENTRY_A ADD (FREQUEST NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY_A' AND KSQL_COL_NAME IN ('FDEMAND')) 
 ALTER TABLE T_SRC_PURLISTENTRY_A ADD (FDEMAND NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY_A' AND KSQL_COL_NAME IN ('FDEMANDVALUE')) 
 ALTER TABLE T_SRC_PURLISTENTRY_A ADD (FDEMANDVALUE NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY_A' AND KSQL_COL_NAME IN ('FREMARK')) 
 ALTER TABLE T_SRC_PURLISTENTRY_A ADD (FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY_A' AND KSQL_COL_NAME IN ('FREPLY')) 
 ALTER TABLE T_SRC_PURLISTENTRY_A ADD (FREPLY NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLISTENTRY_A' AND KSQL_COL_NAME IN ('FREPLYVALUE')) 
 ALTER TABLE T_SRC_PURLISTENTRY_A ADD (FREPLYVALUE NVARCHAR(510) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDDOCENTRY' AND KSQL_COL_NAME IN ('FFILECLASSID')) 
 ALTER TABLE T_SRC_BIDDOCENTRY ADD (FFILECLASSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_DETAIL' AND KSQL_COL_NAME IN ('FCOSTDETAIL')) 
 ALTER TABLE T_SRC_VIE_DETAIL ADD (FCOSTDETAIL CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_NOTYEARINFO' AND KSQL_COL_NAME IN ('FISPRESENT')) 
 ALTER TABLE T_SRC_NOTYEARINFO ADD (FISPRESENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEME' AND KSQL_COL_NAME IN ('FISBIZSCORE')) 
 ALTER TABLE T_SRC_SCHEME ADD (FISBIZSCORE CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEMEINDEX' AND KSQL_COL_NAME IN ('FISSCORETASK')) 
 ALTER TABLE T_SRC_SCHEMEINDEX ADD (FISSCORETASK CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDDOCENTRY_CHG' AND KSQL_COL_NAME IN ('FFILECLASSID')) 
 ALTER TABLE T_SRC_BIDDOCENTRY_CHG ADD (FFILECLASSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIZSCHEMEENTRY' AND KSQL_COL_NAME IN ('FITEMTYPE')) 
 ALTER TABLE T_SRC_BIZSCHEMEENTRY ADD (FITEMTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_APPLYENTRY_A') 
 CREATE TABLE T_SRC_APPLYENTRY_A (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FISPRESENT CHAR(1) DEFAULT '0' NOT NULL
);



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