 EXEC P_ALTERPK 'PK_T_CTBOTP_CONVERTRULE', 'T_CTBOTP_CONVERTRULE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_CV_STENACC') CREATE INDEX IDX_CTBOTP_CV_STENACC ON T_CTBOTP_CONVERTRULE ( FSOURCETENANT ,FSOURCEDATACENTER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_CV_TTENACC') CREATE INDEX IDX_CTBOTP_CV_TTENACC ON T_CTBOTP_CONVERTRULE ( FTARGETTENANT ,FTARGETDATACENTER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_CV_SENTITYNUMBER') CREATE INDEX IDX_CTBOTP_CV_SENTITYNUMBER ON T_CTBOTP_CONVERTRULE ( FSOURCEENTITYNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_CV_TENTITYNUMBER') CREATE INDEX IDX_CTBOTP_CV_TENTITYNUMBER ON T_CTBOTP_CONVERTRULE ( FTARGETENTITYNUMBER );



 EXEC P_ALTERPK 'PK_T_CTBOTP_RULE_SYNCLOG', 'T_CTBOTP_RULE_SYNCLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_SY_RULEID') CREATE INDEX IDX_CTBOTP_SY_RULEID ON T_CTBOTP_RULE_SYNCLOG ( FRULEID );
