/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SCH_TASKTRACE') 
 CREATE TABLE T_SCH_TASKTRACE (
FID BIGINT DEFAULT 0 NOT NULL,
FTASKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSCHEDULEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FJOBID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTASKRECORD NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(4) DEFAULT ' ' NOT NULL,
FMODIFYTIME DATETIME DEFAULT GETDATE() NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SCH_TASKTRACE' AND KSQL_COL_NAME ='FGROUPID')
 ALTER TABLE T_SCH_TASKTRACE ADD (FGROUPID BIGINT DEFAULT 0 NOT NULL );

 EXEC p_AlterColumn 'T_SCH_TASKTRACE', 'FTASKRECORD', 'NCLOB', 'NULL', '1111', 'NULL';


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/
