/**Begin D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_constraint.sql **/
  
 EXEC P_ALTERPK 'PK_RIM_DEDUCT_CONF_R3', 'T_RIM_DEDUCT_CONF_R3', 'FID', '0';
 
/****IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_DEDUCT_CONF_R3') CREATE  CLUSTERED INDEX IDX_RIM_DEDUCT_CONF_R3 ON T_RIM_DEDUCT_CONF_R3 ( FIDX ); ***/

 EXEC P_ALTERPK 'PK_RIM_DEDUCT_CONFIG', 'T_RIM_DEDUCT_CONFIG', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_DEDUCT_CONFIG1') CREATE  CLUSTERED INDEX IDX_RIM_DEDUCT_CONFIG1 ON T_RIM_DEDUCT_CONFIG ( FCREATEORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_DEDUCT_CONFIG2') CREATE INDEX IDX_RIM_DEDUCT_CONFIG2 ON T_RIM_DEDUCT_CONFIG ( FMASTERID );


 EXEC P_ALTERPK 'PK_RIM_DEDUCT_CONFIG_L', 'T_RIM_DEDUCT_CONFIG_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_RIM_DEDUCT_CONFIG_M', 'T_RIM_DEDUCT_CONFIG_M', 'FORGID', '0';

/*** IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_DEDUCT_CONFIG_M') CREATE  CLUSTERED INDEX IDX_RIM_DEDUCT_CONFIG_M ON T_RIM_DEDUCT_CONFIG_M ( FIDX );***/

 EXEC P_ALTERPK 'PK_RIM_DEDUCT_CONFIG_U', 'T_RIM_DEDUCT_CONFIG_U', 'FDATAID,FUSEORGID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_DEDUCT_CONFIG_U') CREATE  CLUSTERED INDEX IDX_RIM_DEDUCT_CONFIG_U ON T_RIM_DEDUCT_CONFIG_U ( FCREATEORGID );


 EXEC P_ALTERPK 'PK_RIM_DEDUCT_CONFIGEXC', 'T_RIM_DEDUCT_CONFIGEXC', 'FDATAID,FUSEORGID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_DEDUCT_CONFIGEXC') CREATE  CLUSTERED INDEX IDX_RIM_DEDUCT_CONFIGEXC ON T_RIM_DEDUCT_CONFIGEXC ( FCREATEORGID );


 EXEC P_ALTERPK 'PK_RIM_DEDUCT_CONFIGUSEREG', 'T_RIM_DEDUCT_CONFIGUSEREG', 'FUSEORGID,FDATAID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_DEDUCT_CONFIGUSEREG') CREATE  CLUSTERED INDEX IDX_RIM_DEDUCT_CONFIGUSEREG ON T_RIM_DEDUCT_CONFIGUSEREG ( FCREATEORGID );



/**End D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_constraint.sql **/
