/**Begin D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_constraint.sql **/
 EXEC P_ALTERPK 'PK_SIM_BATCH', 'T_SIM_BATCH', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_BATCH') CREATE UNIQUE  CLUSTERED INDEX IDX_SIM_BATCH ON T_SIM_BATCH ( FINVOICECODE ,FINVOICENO );


 EXEC P_ALTERPK 'PK_SIM_BATCH_E', 'T_SIM_BATCH_E', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_BATCH_E') CREATE  CLUSTERED INDEX IDX_SIM_BATCH_E ON T_SIM_BATCH_E ( FINVALIDDATE );


 EXEC P_ALTERPK 'PK_SIM_BATCH_ITEM', 'T_SIM_BATCH_ITEM', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_BATCH_ITEM_FK') CREATE  CLUSTERED INDEX IDX_SIM_BATCH_ITEM_FK ON T_SIM_BATCH_ITEM ( FID );



/**End D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_constraint.sql **/
