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: Mass Delete list of product ids sql

  1. #1
    joecalardo is offline Member
    Join Date
    May 2011
    Posts
    61

    Default Mass Delete list of product ids sql

    How can I mass delete product ids from the database thru sql ? I'm trying to get the excel import feature to work for me, and I uploaded correctly however not showing on my live site because I set published to 0, but in my admin it says they are published, so I want to remove and try again. thanks!

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

    Default

    There is a published flag on both the Product and ProductVariant tables. So, if your Product is showing as published, maybe your ProductVariant is not. You could try:

    Code:
    UPDATE Product SET Published=1
    UPDATE ProductVariant SET Published=1
    That will set all of the products and all of their variants to published.

    Note: With any of these SQL queries you are asking for, you should be trying them out on a development database prior to running them on your production website.
    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!

  3. #3
    jsimacek is offline Senior Member
    Join Date
    Dec 2008
    Location
    Phoenix, AZ
    Posts
    373

    Default

    You could write the SQL like:

    UPDATE Product SET Deleted=1 WHERE ProductID IN (1,2,3,4, etc)

    You could also get an add-on for mass deleting/nuking available at http://www.ecommercecartmods.com/p-3...torefront.aspx or this one for mass publishing etc http://www.ecommercecartmods.com/p-3...torefront.aspx

    Remember, you should be deleting/publishing both the product and variants...
    Jan Simacek - Compunix, LLC
    AspDotNetStorefront trusted Devnet Partner and Reseller since 2005

    AspDotNetStorefront Mods and Add-Ons at http://www.ecommercecartmods.com/
    - Searching, Filtering and Sorting (like cSearch, Dealer Locator, Price Ranges, Blog)
    - Reports (like Cart Abandonment and Net Sales)
    - Customer Experience (like Question/Answers)
    - Site and Data Management (like Entity Product Mapper, Bulk Updaters, Make/Model/Year filters)