 EXEC P_ALTERPK 'PK_T_BCM_INVRELATIONSET', 'T_BCM_INVRELATIONSET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVRELATIONSET_M') CREATE INDEX IDX_BCM_INVRELATIONSET_M ON T_BCM_INVRELATIONSET ( FMODELID );
 
 
  EXEC P_ALTERPK 'PK_T_BCM_INVRELATIONDEFINE_L', 'T_BCM_INVRELATIONDEFINE_L', 'FPKID', '1';


 
 
 
 
 
  EXEC P_ALTERPK 'PK_T_BCM_INVRELATIONDEFINE', 'T_BCM_INVRELATIONDEFINE', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVRELADEFINE_FID') CREATE INDEX IDX_BCM_INVRELADEFINE_FID ON T_BCM_INVRELATIONDEFINE ( FID );
 
 
 
 
 EXEC p_DropIdx 'IDX_BCM_INVRELADEFINE_L_FID', 'T_BCM_INVRELATIONDEFINE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVRELADEFINE_L_FID') CREATE INDEX IDX_BCM_INVRELADEFINE_L_FID ON T_BCM_INVRELATIONDEFINE_L ( FENTRYID );

 
 
 