Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Deleting old categories and products

  1. #1
    bruceg is offline Junior Member
    Join Date
    Dec 2008
    Posts
    10

    Default Deleting old categories and products

    We have a mess of soft deleted and unpublished products and categories left over from when we initially setup our site. I am doing some data validation queries in the tables and would like to clean out the junk. Are there any problems with deleting unpublished and soft deleted categories directly from SQL Management Studio Express? Thanks.

  2. #2
    Richnyc30 is offline Senior Member
    Join Date
    Mar 2009
    Posts
    340

    Default Deleting products

    Checck this thread. I used the code below this week andit worked. We then imported the products to clean tables.

    showthread.php?t=17527&highlight=delete ------------------------------------------
    To do this, run the following SQL statements against your store database. This removes these products for good, there is no recovering them! Be sure you have a good backup first.

    DELETE FROM Product
    DELETE FROM ProductAffiliate
    DELETE FROM ProductCategory
    DELETE FROM ProductCustomerLevel
    DELETE FROM ProductDistributor
    DELETE FROM ProductGenre
    DELETE FROM ProductLocaleSetting
    DELETE FROM ProductManufacturer
    DELETE FROM ProductSection
    DELETE FROM ProductVariant
    DELETE FROM ProductVector
    DELETE FROM ShippingByProduct

  3. #3
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    Actually, using TRUNCATE TABLE tablename, both removes all data and resets the identity counter to the seed at the same time.

    It is faster than a delete statement which removes one row at a time, and the deletes are recorded in the transaction log.
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!