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: What is the purpose of the OrderNumbers table in the DB?

  1. #1
    shark92651 is offline Member
    Join Date
    Jan 2006
    Posts
    81

    Default What is the purpose of the OrderNumbers table in the DB?

    I am working on a script to clear out old orders and the purpose of this table isn't readily apparent to me. Is this related to the Orders table?

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

    Default

    The OrderNumbers table generates the next unique OrderNumber. The OrderNumber column is defined with an identity specification where the number automatically increases by 1 every time a new record is inserted. This number is then used in the Orders table.

    If you're removing records from the Orders table and the other related order tables then it would be reasonable to remove the related records in the OrderNumbers table as well, for integrity.

    Of course, if you remove orders then the totals on the admin homepage won't necessarily reflect the business you've done.
    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
    shark92651 is offline Member
    Join Date
    Jan 2006
    Posts
    81

    Default

    Quote Originally Posted by esedirect View Post
    The OrderNumbers table generates the next unique OrderNumber. The OrderNumber column is defined with an identity specification where the number automatically increases by 1 every time a new record is inserted. This number is then used in the Orders table.

    If you're removing records from the Orders table and the other related order tables then it would be reasonable to remove the related records in the OrderNumbers table as well, for integrity.

    Of course, if you remove orders then the totals on the admin homepage won't necessarily reflect the business you've done.
    Thanks for the reply. I don't understand why they cant just have the identify field in the Orders table itself, there must be a use case in there somewhere that I am not grasping at this time.

    Now that I have the problem with the Profile table under control, I may not need to clear out old orders at this time afterall. I was concerned that I was approaching the 10GB database limit of SQL Express 2008.