/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/
 EXEC p_AlterColumn 'T_CTS_TERMWORDLOG', 'FSRCTERM', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_CTS_TERMWORDLOG', 'FDESTTERM', 'NVARCHAR(1024)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTS_TERMWORDLOG' AND KSQL_COL_NAME ='FTERMWORDCOMP') 
 ALTER TABLE T_CTS_TERMWORDLOG ADD (FTERMWORDCOMP NVARCHAR(1024) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTS_TERMWORDLOG' AND KSQL_COL_NAME ='FTYPE') 
 ALTER TABLE T_CTS_TERMWORDLOG ADD (FTYPE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CTS_TERMWORDAPPLYLOG') 
 CREATE TABLE T_CTS_TERMWORDAPPLYLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FNEWNAME NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FOLDNAME NVARCHAR(1024) DEFAULT ' ' NOT NULL,
FCLOUDID VARCHAR(36) DEFAULT ' ' NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTERMWORDLOGID BIGINT DEFAULT 0 NOT NULL,
FLANID BIGINT DEFAULT 0 NOT NULL,
FTERMWORDCOMPID BIGINT DEFAULT 0 NOT NULL,
FSOURCEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSOURCENUMBER VARCHAR(36) DEFAULT ' ' NOT NULL
);



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