/**Begin C:\anzhuang\PDM_UPGRADE\PDM1\BDTAXR_constraint.sql **/
 EXEC P_ALTERPK 'PK_BD_TAXAPTITUDES', 'T_BD_TAXAPTITUDES', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TAXAPTITUDES_CREATEORG') CREATE INDEX IDX_TAXAPTITUDES_CREATEORG ON T_BD_TAXAPTITUDES ( FCREATEORGID );

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


 EXEC P_ALTERPK 'PK_BD_TAXAPTITUDES_L', 'T_BD_TAXAPTITUDES_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_TAXAPTITUDES_U', 'T_BD_TAXAPTITUDES_U', 'FDATAID,FUSEORGID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_TAXAPTITUDES_U_UO') CREATE INDEX IDX_T_BD_TAXAPTITUDES_U_UO ON T_BD_TAXAPTITUDES_U ( FUSEORGID );


 EXEC P_ALTERPK 'PK_T_BD_TAXAPTITUDESEXC', 'T_BD_TAXAPTITUDESEXC', 'FDATAID,FUSEORGID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_TAXAPTITUDESEXC_UO') CREATE INDEX IDX_T_BD_TAXAPTITUDESEXC_UO ON T_BD_TAXAPTITUDESEXC ( FUSEORGID );


 EXEC P_ALTERPK 'PK_T_BD_TAXAPTITUDESUSEREG', 'T_BD_TAXAPTITUDESUSEREG', 'FUSEORGID,FDATAID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_TAXAPTITUDESUSEREG_D') CREATE INDEX IDX_T_BD_TAXAPTITUDESUSEREG_D ON T_BD_TAXAPTITUDESUSEREG ( FDATAID );



/**End C:\anzhuang\PDM_UPGRADE\PDM1\BDTAXR_constraint.sql **/
