 EXEC P_ALTERPK 'PK_PUR_INVENTORYLOG', 'T_PUR_INVENTORYLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_INVENTORYLOG_SUP') CREATE INDEX IDX_PUR_INVENTORYLOG_SUP ON T_PUR_INVENTORYLOG ( FSUPPLIERID ,FMATERIALID );


 EXEC P_ALTERPK 'PK_PUR_SUPPLIERSTOCK', 'T_PUR_SUPPLIERSTOCK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_SUPPLIER_STOCK') CREATE INDEX IDX_PUR_SUPPLIER_STOCK ON T_PUR_SUPPLIERSTOCK ( FSUPPLIERID );