/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER' AND KSQL_COL_NAME IN ('FBIZAMOUNT')) 
 ALTER TABLE T_SRC_INVITESUPPLIER ADD (FBIZAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FEVALUATEDATE')) 
 ALTER TABLE T_SRC_EXPORT ADD (FEVALUATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FEVALUATETYPEID')) 
 ALTER TABLE T_SRC_EXPORT ADD (FEVALUATETYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FEVALUATEFROM')) 
 ALTER TABLE T_SRC_EXPORT ADD (FEVALUATEFROM DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FEVALUATETO')) 
 ALTER TABLE T_SRC_EXPORT ADD (FEVALUATETO DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FEVALUATESCORE')) 
 ALTER TABLE T_SRC_EXPORT ADD (FEVALUATESCORE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FEVALUATEGRADEID')) 
 ALTER TABLE T_SRC_EXPORT ADD (FEVALUATEGRADEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FPAUSEFROM')) 
 ALTER TABLE T_SRC_EXPORT ADD (FPAUSEFROM DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FPAUSETO')) 
 ALTER TABLE T_SRC_EXPORT ADD (FPAUSETO DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTCATEGORY') 
 CREATE TABLE T_SRC_EXPERTCATEGORY (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTAPTITUDE') 
 CREATE TABLE T_SRC_EXPERTAPTITUDE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPTITUDETYPEID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISSUEORG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAPTITUDENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FGRADE VARCHAR(20) DEFAULT ' ' NOT NULL,
FISSUEDATE DATETIME,
FDATETO DATETIME,
FCHECKDATE DATETIME,
FAPTITUDENOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EXPERTAPTITUDE_FJ') 
 CREATE TABLE T_SRC_EXPERTAPTITUDE_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 **/
