/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMAND' AND KSQL_COL_NAME IN ('FPARENTID')) 
 ALTER TABLE T_SRC_DEMAND ADD (FPARENTID NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMAND' AND KSQL_COL_NAME IN ('FORIGIN')) 
 ALTER TABLE T_SRC_DEMAND ADD (FORIGIN CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMAND' AND KSQL_COL_NAME IN ('FPENTITYKEY')) 
 ALTER TABLE T_SRC_DEMAND ADD (FPENTITYKEY NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMAND' AND KSQL_COL_NAME IN ('FENTITYKEY')) 
 ALTER TABLE T_SRC_DEMAND ADD (FENTITYKEY NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_N' AND KSQL_COL_NAME IN ('FSUBMITTERID')) 
 ALTER TABLE T_SRC_PROJECT_N ADD (FSUBMITTERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_N' AND KSQL_COL_NAME IN ('FSUBMITDATE')) 
 ALTER TABLE T_SRC_PROJECT_N ADD (FSUBMITDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_N' AND KSQL_COL_NAME IN ('FUNSUBMITTERID')) 
 ALTER TABLE T_SRC_PROJECT_N ADD (FUNSUBMITTERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_N' AND KSQL_COL_NAME IN ('FUNSUBMITDATE')) 
 ALTER TABLE T_SRC_PROJECT_N ADD (FUNSUBMITDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_N' AND KSQL_COL_NAME IN ('FUNAUDITDATE')) 
 ALTER TABLE T_SRC_PROJECT_N ADD (FUNAUDITDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_N' AND KSQL_COL_NAME IN ('FUNAUDITORID')) 
 ALTER TABLE T_SRC_PROJECT_N ADD (FUNAUDITORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_N' AND KSQL_COL_NAME IN ('FLASTUPDATEUSERID')) 
 ALTER TABLE T_SRC_PROJECT_N ADD (FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_N' AND KSQL_COL_NAME IN ('FLASTUPDATETIME')) 
 ALTER TABLE T_SRC_PROJECT_N ADD (FLASTUPDATETIME DATETIME );

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