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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_DECLARATION_BATCHNO') CREATE  CLUSTERED INDEX IDX_SIM_DECLARATION_BATCHNO ON T_SIM_DECLARATION_RECORD ( FBATCHNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_DECLARATION_ORG') CREATE INDEX IDX_SIM_DECLARATION_ORG ON T_SIM_DECLARATION_RECORD ( FORG );


 EXEC P_ALTERPK 'PK_SIM_DECLARATION_BILL', 'T_SIM_DECLARATION_BILL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_SIM_DECLARATION_BILL') CREATE  CLUSTERED INDEX INDEX_SIM_DECLARATION_BILL ON T_SIM_DECLARATION_BILL ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INDEX_SIM_DECLARATION_BILL2') CREATE INDEX INDEX_SIM_DECLARATION_BILL2 ON T_SIM_DECLARATION_BILL ( FENTRYID );


 EXEC P_ALTERPK 'PK_SIM_DECLARATION_ITEMS', 'T_SIM_DECLARATION_ITEMS', 'FENTRYID', '0';

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



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