> ## Content Index
> Fetch the complete content index at: https://blog.tsd.digital/llms.txt
> Use this file to discover other available public pages before exploring further.

# Quickly delete all products and orders from uCommerce
- URL: https://blog.tsd.digital/quickly-delete-all-products-and-orders-from-ucommerce/
- Published: 2013-05-11T09:09:59.000Z
- Updated: 2013-05-11T09:09:59.000Z
- Author: Tim Gaunt
- Tags: Script, SQL, Ucommerce, Useful Script, QL, Useful, #Import 2025-04-01 05:37

**Note:** An updated version of this code for the new Ucommerce schema is available here: [https://thesitedoctor.co.uk/blog/delete-all-products-and-orders-from-ucommerce/](https://blog.tsd.digital/blog/delete-all-products-and-orders-from-ucommerce/)

Sometimes you need to blitz your [uCommerce](http://ucommerce.dk/?ref=blog.tsd.digital) database e.g. just before launch or to remove the testing products etc.

This is a quick database clear script which will clear delete all orders and products in [uCommerce](http://ucommerce.dk/?ref=blog.tsd.digital).

Be careful - this will remove everything without any form of checks (this is the V3 script let me know if you need it for other versions).

BEGIN TRAN DELETE FROM uCommerce\_ProductReviewComment DELETE FROM uCommerce\_ProductReview DELETE FROM uCommerce\_OrderLineDiscountRelation DELETE FROM uCommerce\_ShipmentDiscountRelation DELETE FROM uCommerce\_Discount UPDATE uCommerce\_OrderLine SET ShipmentId = NULL UPDATE uCommerce\_PurchaseOrder SET BillingAddressId = NULL DELETE FROM uCommerce\_Shipment DELETE FROM uCommerce\_OrderAddress DELETE FROM uCommerce\_OrderProperty DELETE FROM uCommerce\_OrderLine DELETE FROM uCommerce\_PaymentProperty DELETE FROM uCommerce\_Payment DELETE FROM uCommerce\_OrderStatusAudit DELETE FROM uCommerce\_PurchaseOrder DELETE FROM uCommerce\_Address DELETE FROM uCommerce\_Customer DELETE uCommerce\_ProductRelation DELETE uCommerce\_ProductProperty DELETE uCommerce\_ProductDescriptionProperty DELETE uCommerce\_ProductDescription DELETE uCommerce\_CategoryProductRelation DELETE uCommerce\_PriceGroupPrice DELETE FROM uCommerce\_Product -- Just double check things have gone SELECT \* FROM uCommerce\_PurchaseOrder o SELECT \* FROM uCommerce\_Product p -- For safety's sake, run it in a transaction just in case you change your mind ROLLBACK TRAN -- When happy it works, uncomment this line and comment out the ROLLBACK -- COMMIT TRAN