EXEC P_ALTERPK 'PK_T_BD_SUPPLIER_B', 'T_BD_SUPPLIER_B', 'FID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'DX_T_BD_SUPPLIE_BL_ORGSTRAT') CREATE INDEX DX_T_BD_SUPPLIE_BL_ORGSTRAT ON T_BD_SUPPLIER_B ( FINTERNALCOMPANYID );

EXEC P_ALTERPK 'PK_T_BD_SUPPLIERSITEBANK', 'T_BD_SUPPLIERSITEBANK', 'FENTRYID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SUPPLIERSITEBANK_SUPP') CREATE INDEX IDX_BD_SUPPLIERSITEBANK_SUPP ON T_BD_SUPPLIERSITEBANK ( FID );

EXEC P_ALTERPK 'PK_T_BD_SUPPLIERSITEBANK_L', 'T_BD_SUPPLIERSITEBANK_L', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SUPPLIERSTIEBANK_L_ENTR') CREATE INDEX IDX_BD_SUPPLIERSTIEBANK_L_ENTR ON T_BD_SUPPLIERSITEBANK_L ( FENTRYID ,FLOCALEID );

EXEC P_ALTERPK 'PK_T_BD_SUPPLIERADDRESS_L', 'T_BD_SUPPLIERADDRESS_L', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPLIERADDRESS_L_FID') CREATE INDEX IDX_T_BD_SUPPLIERADDRESS_L_FID ON T_BD_SUPPLIERADDRESS_L ( FID ,FLOCALEID );

EXEC P_ALTERPK 'PK_T_BD_SUPPLIERSITE_L', 'T_BD_SUPPLIERSITE_L', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPLIERSITE_L_FID') CREATE INDEX IDX_T_BD_SUPPLIERSITE_L_FID ON T_BD_SUPPLIERSITE_L ( FID ,FLOCALEID );

EXEC P_ALTERPK 'PK_T_BD_SUPPLIERADDRESS', 'T_BD_SUPPLIERADDRESS', 'FID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPADD_NUMBER') CREATE INDEX IDX_T_BD_SUPPADD_NUMBER ON T_BD_SUPPLIERADDRESS ( FNUMBER );
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPADD_SUPPLIERID') CREATE INDEX IDX_T_BD_SUPPADD_SUPPLIERID ON T_BD_SUPPLIERADDRESS ( FSUPPLIERID );

EXEC P_ALTERPK 'PK_T_BD_SUPPLIERSITE', 'T_BD_SUPPLIERSITE', 'FID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPLIERSITE_NUMBER') CREATE INDEX IDX_T_BD_SUPPLIERSITE_NUMBER ON T_BD_SUPPLIERSITE ( FNUMBER );