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: Need with SQL query

  1. #1
    medsupply is offline Senior Member
    Join Date
    Jul 2011
    Posts
    99

    Default Need with SQL query

    I need to delete a bunch of manufacturers. Can somebody help with a query to delete them knowing their ID #s?

    Need to do the same with a bunch of categories.

    I am using 9.3.0.0/9.3.0.0

    Thanks a lot!
    Last edited by medsupply; 06-10-2013 at 12:24 PM.

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

    Default

    This will break the link between the product and the manufacturer

    Code:
    DELETE FROM ProductManufacturer WHERE ManufacturerID IN (1,2,3,4....,n)
    And this will delete the manufacturer
    Code:
    DELETE FROM Manufacturer WHERE ManufacturerID IN (1,2,3,4....,n)
    Or you could do the 'soft delete' which marks them as deleted, but doesn't actually delete the manufacturers from the table
    Code:
    UPDATE Manufacturer SET Deleted=1 WHERE ManufacturerID IN (1,2,3,4....,n)
    As always, try this on a development database before doing it on your live database, if you are unsure!
    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
    medsupply is offline Senior Member
    Join Date
    Jul 2011
    Posts
    99

    Default

    Thanks a lot!