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 6 of 6

Thread: Database bulk edit help

  1. #1
    TheGlowPro is offline Member
    Join Date
    Mar 2006
    Posts
    74

    Default Database bulk edit help

    Hello, I've now got our createaccount.aspx modified so that all new users can only select residential as their address type. We were getting killed by customers selecting commercial to receive fedex ground rates instead of home delivery. I had tried to just filter Fedex Ground but when customers were using a free shipping coupon code that had created their account with a commercial address type, no free shipping methods were being returned. What I need to do now is find a way to change the shipping address type for all our existing customers in the database so the next time they re-order they won't run into the same problem. Can anyone share with me the SQL code I need to run to bulk edit this change?

  2. #2
    ZachJ85 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philadelphia, PA
    Posts
    99

    Default

    I'm not sure if I follow. Do you just want a simple SQL statement that will update all your customers that have address type 'A' to now say address type 'B'?
    SQL 2008, Visual Studio 2010
    Source: C#
    Version: AspDotNetStorefront ML 8.0.1.1/8.0.1.1
    Framework: .Net 4.0 (Running)

  3. #3
    TheGlowPro is offline Member
    Join Date
    Mar 2006
    Posts
    74

    Red face

    Quote Originally Posted by ZachJ85 View Post
    I'm not sure if I follow. Do you just want a simple SQL statement that will update all your customers that have address type 'A' to now say address type 'B'?
    Yes, that's exactly it. I have customers in the database shippingaddresstype currently mixed between residential, commercial, unknown. I'd like the SQL statement to set them all to residential. I already changed the create account page to set residential as the only option. What would be really useful is an appconfig that would allow us to forceallresidential=true.

    Btw, is it possible to just remove the prompt and the drop down menu completely for new accounts and just have the system return residential rates in the background? I'm sorry if these are stupid questions, I'm a business owner not a programmer.

  4. #4
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    You can run an update query like below:

    Code:
    Update Customer set ResidenceType=1
    You can place a whereclause in case you only want to update selected records.

    Where:
    Unknown = 0,
    Residential = 1,
    Commercial = 2

  5. #5
    TheGlowPro is offline Member
    Join Date
    Mar 2006
    Posts
    74

    Default

    I just cut and paste that and hit execute, right? I'm more concerned about the shipping address type than I am the billing as that seems to determine the rates that get returned.

  6. #6
    ZachJ85 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philadelphia, PA
    Posts
    99

    Default

    Yeah, that is cut and paste code that he posted. Just to be clear if you do run that, EVERYONE in the Customer table will now have ResidenceType=1. Is that ok?
    SQL 2008, Visual Studio 2010
    Source: C#
    Version: AspDotNetStorefront ML 8.0.1.1/8.0.1.1
    Framework: .Net 4.0 (Running)