/**Begin D:\PDM_UPGRADE\PDM1\FCS_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SAFETYINSPECT_R')
 CREATE TABLE T_FCS_SAFETYINSPECT_R (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSRCBILLENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESTBILLENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPUSHTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCOUNT INT DEFAULT 0 NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FCS_TASKFLOW_TASK' AND KSQL_COL_NAME IN ('FISCYCLE'))
 ALTER TABLE T_FCS_TASKFLOW_TASK ADD (FISCYCLE CHAR(1) DEFAULT '0' NOT NULL );

/**End D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
