Delete a Magento order in 1.9 using MySQL

To delete an order from Magento 1.9 using SQL - "100001234" is the order number :

SET @increment_id='100001234';
SELECT @order_id:=entity_id FROM sales_flat_order WHERE increment_id=@increment_id;
DELETE FROM sales_flat_order WHERE entity_id=@order_id;
DELETE FROM sales_flat_order WHERE increment_id=@increment_id;
DELETE FROM sales_flat_invoice WHERE increment_id=@increment_id;
DELETE FROM sales_flat_shipment WHERE increment_id=@increment_id;
DELETE FROM sales_flat_creditmemo WHERE increment_id=@increment_id;
DELETE FROM sales_flat_order_item WHERE order_id=@order_id;

 

Leave a Reply