 /**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_constraint.sql **/
 EXEC P_ALTERPK 'PK_IM_MDC_OMCMPLINBILL', 'T_IM_MDC_OMCMPLINBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_OMCMPLINBILL') CREATE INDEX IDX_IM_MDC_OMCMPLINBILL ON T_IM_MDC_OMCMPLINBILL ( FINVSCHEMEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_OMCMPL_IDTN') CREATE INDEX IDX_IM_MDC_OMCMPL_IDTN ON T_IM_MDC_OMCMPLINBILL ( FORGID ,FBIZTIME  DESC ,FBILLNO  DESC );

 
 EXEC P_ALTERPK 'PK_IM_MDC_OMCMPLINBILL_L', 'T_IM_MDC_OMCMPLINBILL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_OMCMPLINBILL_L_0') CREATE INDEX IDX_IM_MDC_OMCMPLINBILL_L_0 ON T_IM_MDC_OMCMPLINBILL_L ( FID ,FLOCALEID );

 
 EXEC P_ALTERPK 'PK_IM_MDC_OMCPBILLENTRY', 'T_IM_MDC_OMCPBILLENTRY', 'FENTRYID', '1';

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

 
 EXEC P_ALTERPK 'PK_IM_MDC_OMCPBILLENTRY_L', 'T_IM_MDC_OMCPBILLENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_MDC_OMCPBILLENTRY_L_0') CREATE INDEX IDX_IM_MDC_OMCPBILLENTRY_L_0 ON T_IM_MDC_OMCPBILLENTRY_L ( FENTRYID ,FLOCALEID );

 
 EXEC P_ALTERPK 'PK_IM_MDC_OMCPBILLENTRY_M', 'T_IM_MDC_OMCPBILLENTRY_M', 'FENTRYID', '1';

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

 EXEC P_ALTERPK 'PK_IM_MDC_OMCPBILLENTRY_R', 'T_IM_MDC_OMCPBILLENTRY_R', 'FENTRYID', '1';

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

 EXEC P_ALTERPK 'PK_IM_MDC_OMCPBILLENTRY_X', 'T_IM_MDC_OMCPBILLENTRY_X', 'FENTRYID', '1';

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

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

 


