-- 变更单主、副账簿分录表索引语句
 EXEC p_AlterPK 'PK_FA_CHANGEBILLMAINENTRY', 'T_FA_CHANGEBILLMAINENTRY', 'FENTRYID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_CHANGEBILLMAINENTRY' AND KSQL_INDNAME = 'IDX_FA_CHANGEBILLMAINENTRY')
 CREATE INDEX IDX_FA_CHANGEBILLMAINENTRY ON T_FA_CHANGEBILLMAINENTRY (FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_CHANGEBILLMAINENTRY' AND KSQL_INDNAME = 'IDX_FA_MAINENTRY_REALID')
 CREATE INDEX IDX_FA_MAINENTRY_REALID ON T_FA_CHANGEBILLMAINENTRY (FREALCARDID );


 EXEC p_AlterPK 'PK_FA_CHANGEBILLOTHERENTRY', 'T_FA_CHANGEBILLOTHERENTRY', 'FENTRYID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_CHANGEBILLOTHERENTRY' AND KSQL_INDNAME = 'IDX_FA_CHANGEBILLOTHERENTRY')
 CREATE INDEX IDX_FA_CHANGEBILLOTHERENTRY ON T_FA_CHANGEBILLOTHERENTRY (FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_CHANGEBILLOTHERENTRY' AND KSQL_INDNAME = 'IDX_FA_OTHERENTRY_REALID')
 CREATE INDEX IDX_FA_OTHERENTRY_REALID ON T_FA_CHANGEBILLOTHERENTRY (FREALCARDID );