Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Deleting products in Bulk from table


ollyno1uk2

Recommended Posts

Hi there

 

I currently have 2000 products with a status of 0 that are clogging up my database. I would like to delete them.

 

Can I jsut delete them from the products table or would they need to be removed from products, products_description and products_to_categories?

 

Would something like this work as an SQL?

 

delete from products, products_description, products_to_categories

where products.products_status = 0

 

 

 

Thanks

Link to comment
Share on other sites

Hi there

 

I currently have 2000 products with a status of 0 that are clogging up my database. I would like to delete them.

 

Can I jsut delete them from the products table or would they need to be removed from products, products_description and products_to_categories?

 

Would something like this work as an SQL?

 

delete from products, products_description, products_to_categories

where products.products_status = 0

Thanks

 

You don't have to specigy the other tables. products is the parent, and the rest of the child(ren) of products.

It will do a cascading delete if you simply type :

delete from products where products_status = 0

 

david

Link to comment
Share on other sites

You don't have to specigy the other tables. products is the parent, and the rest of the child(ren) of products.

It will do a cascading delete if you simply type :

delete from products where products_status = 0

 

david

 

 

Ok thanks very much. I will give it a try!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...