/**Begin D:\pdm\PDM_UPGRADE\pdm_new\RIM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_RIM_INVOICE_FILE_HIS2', 'T_RIM_INVOICE_FILE_HIS2', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INVOICE_FILE_HIS2A') CREATE  CLUSTERED INDEX IDX_RIM_INVOICE_FILE_HIS2A ON T_RIM_INVOICE_FILE_HIS2 ( FSERIAL_NO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INVOICE_FILE_HIS2B') CREATE INDEX IDX_RIM_INVOICE_FILE_HIS2B ON T_RIM_INVOICE_FILE_HIS2 ( FOPERATE_TIME ,FTRACEID );


 EXEC P_ALTERPK 'PK_RIM_INVOICE_SNAPSHOT', 'T_RIM_INVOICE_SNAPSHOT', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INVOICE_SNAPSHOT') CREATE  CLUSTERED INDEX IDX_RIM_INVOICE_SNAPSHOT ON T_RIM_INVOICE_SNAPSHOT ( FFILE_HASH );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INVOICE_SNAPSHOT2') CREATE INDEX IDX_RIM_INVOICE_SNAPSHOT2 ON T_RIM_INVOICE_SNAPSHOT ( FCREATE_TIME ,FFILE_NAME );



/**End D:\pdm\PDM_UPGRADE\pdm_new\RIM_constraint.sql **/
