/**Begin D:\PDM_UPGRADE\PDM1\kd_1.5.133_ai_asstacttype_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_AI_STANDARDEVENTENTITY', 'T_AI_STANDARDEVENTENTITY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_AI_STANDARDEVENTENTITY') CREATE INDEX INDEX_AI_STANDARDEVENTENTITY ON T_AI_STANDARDEVENTENTITY ( FID );


 EXEC P_ALTERPK 'PK_T_AI_STANDARDEVENT_L', 'T_AI_STANDARDEVENT_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AI_STANDARDEVENT_L_FID') CREATE INDEX IDX_AI_STANDARDEVENT_L_FID ON T_AI_STANDARDEVENT_L ( FID );


 EXEC P_ALTERPK 'PK_T_AI_STANDARDEVENT', 'T_AI_STANDARDEVENT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AI_STANDARDEVENT') CREATE INDEX IDX_AI_STANDARDEVENT ON T_AI_STANDARDEVENT ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_AI_MOREBILLTYPE', 'T_AI_MOREBILLTYPE', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_AI_MOREBILLTYPE') CREATE INDEX INDEX_AI_MOREBILLTYPE ON T_AI_MOREBILLTYPE ( FID );


 EXEC P_ALTERPK 'PK_T_AI_MOREASSTACTTYPE', 'T_AI_MOREASSTACTTYPE', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_AI_MOREASSTACTTYPE') CREATE INDEX INDEX_AI_MOREASSTACTTYPE ON T_AI_MOREASSTACTTYPE ( FID );


 EXEC P_ALTERPK 'PK_T_AI_ASSTACTTYPE', 'T_AI_ASSTACTTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AI_ASSTACTTYPE') CREATE INDEX IDX_AI_ASSTACTTYPE ON T_AI_ASSTACTTYPE ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AI_ASSTACTTYPE_INDEX') CREATE UNIQUE INDEX IDX_AI_ASSTACTTYPE_INDEX ON T_AI_ASSTACTTYPE ( FINDEX );


 EXEC P_ALTERPK 'PK_T_AI_ASSTACTTYPE_L', 'T_AI_ASSTACTTYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_AI_ASSTACTTYPE_L_LID') CREATE INDEX IDX_T_AI_ASSTACTTYPE_L_LID ON T_AI_ASSTACTTYPE_L ( FID );



/**End D:\PDM_UPGRADE\PDM1\kd_1.5.133_ai_asstacttype_constraint.sql **/
