/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FTENDENCY')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FTENDENCY CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FTAXTYPE')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FTAXTYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FBIDNUMBER')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FBIDNUMBER INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FWINERQTY')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FWINERQTY INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FAUTOCONFIRM')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FAUTOCONFIRM CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FREDUCETYPE')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FREDUCETYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FREDUCEPCT')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FREDUCEPCT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FLASTTIME')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FLASTTIME INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FDELAYTIME')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FDELAYTIME INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FADDTIMENUM')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FADDTIMENUM INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FBIDCOUNT')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FBIDCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FOPEN2')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FOPEN2 CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FOPEN1')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FOPEN1 CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_VIE_TURNS' AND KSQL_COL_NAME IN ('FOPEN4')) 
 ALTER TABLE T_SRC_VIE_TURNS ADD (FOPEN4 CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTPROJECT') 
 CREATE TABLE T_SRC_EXPERTPROJECT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPARTICIPATETIME DATETIME,
FBIDUNIT NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBIDPROJECT NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPROJECTNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);



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