

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CTBOTP_SYNCROUTE')
 CREATE TABLE T_CTBOTP_SYNCROUTE (
FID BIGINT DEFAULT 0 NOT NULL,
FSTENANTCODE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSACCOUNTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FSENTITYKEY VARCHAR(36) DEFAULT ' ' NOT NULL,
FTTENANTCODE VARCHAR(50) DEFAULT ' ' NOT NULL,
FTACCOUNTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FTENTITYKEY VARCHAR(36) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL
);


EXEC P_ALTERPK 'PK_T_CTBOTP_SYNCROUTE', 'T_CTBOTP_SYNCROUTE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_SYNCROUTE_SENTITYKEY') CREATE INDEX IDX_CTBOTP_SYNCROUTE_SENTITYKEY ON T_CTBOTP_SYNCROUTE ( FSENTITYKEY );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_SYNCROUTE_TENTITYKEY') CREATE INDEX IDX_CTBOTP_SYNCROUTE_TENTITYKEY ON T_CTBOTP_SYNCROUTE ( FTENTITYKEY );





