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

Thread: Delete anonymous customers records

  1. #1
    azwarian is offline Junior Member
    Join Date
    Aug 2008
    Posts
    11

    Default Delete anonymous customers records

    Hi everyone,

    I need to "delete" some anonymous customer records from the customers table (select * from customer where IsRegistered=0) to fix an issue with missing details, but am unsure on the proper way to approach things....

    As the email column on these records is only blank, I am assuming that if I should only need to set the deleted column as true. Is there anything else that needs to be done?

    Any help or advice would be much aprpeciated! My support from response is below

    Thanks a million guys I really appreciated it!

    Ok, the problem here is that you did have anonymous checkout enabled at one time in the past. You can verify that yourself by looking in the Customer table in the database - you have 369 records with an email address but IsRegistered=0. That means that the customer checkout out anonymously previously. Any time one of those customers returns to the site and tries to purchase again, they're going to run into this issue. The site already has a record of their email address and since you don't allow duplicates they can't register a new account, but the old record doesn't have any data on it since they went through anonymously.

    To prevent this from happening again, you're going to want to either remove those old anonymous records from the DB so the customers can register without any issues next time, or convert them into a registered account. We cannot advise you on how to do either, but they're both pretty simple tasks. Just make sure that you have a full backup of the database first just in case.

  2. #2
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    I strongly recommend a soft deletion instead to ensure record keeping, in case, you have order records that was transacted against this Anons. You could use this query:
    Code:
    UPDATE Customer SET Deleted = 1 WHERE IsRegistered = 0

  3. #3
    azwarian is offline Junior Member
    Join Date
    Aug 2008
    Posts
    11

    Default

    Hi Jao,

    Thanks for the reply mate, I really appreciate it.

    However, as per the response from support, do you think doing a "soft delete" would get rid of the issue? Would the customers be able to sign up again using the same email?

    The site already has a record of their email address and since you don't allow duplicates they can't register a new account, but the old record doesn't have any data on it since they went through anonymously.

    Looking forward to your response.

    Cheers!

  4. #4
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Nope, they won't be able to sign-up, considering that the query used to allow an access checks if the Deleted column is 0 and IsRegistered is equal to 1, other than that, Access is impossible.

  5. #5
    azwarian is offline Junior Member
    Join Date
    Aug 2008
    Posts
    11

    Default

    So if i Set Deleted = 1, IsRegistered = 0 then they should be able to sign up again correct?

    I do have a backup of the database but just want to be 110% sure that I'm doing the right thing before touching anything

    thanks mate!

  6. #6
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Kind of confused by this statement:
    So if i Set Deleted = 1, IsRegistered = 0 then they should be able to sign up again correct?
    Or you mean, they shouldn't be able to sign up, if so, yes, if Deleted =1 and IsRegistered = 0, it's impossible to login, unless, otherwise, you tweak the code to bypass this condition, which is unnecessary and unrecommended.

  7. #7
    azwarian is offline Junior Member
    Join Date
    Aug 2008
    Posts
    11

    Default

    Hey Jao,

    I'm also confused mate..... but basically in a nutshell I want to know if a soft delete will allow the customers to sign back up again using the email that is associated with the affected records or if i need to physically remove them from the DB table so that they can sign up again using the same email?

    Cheers

  8. #8
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Well, the note above could help as a clarification:
    To prevent this from happening again, you're going to want to either remove those old anonymous records from the DB so the customers can register without any issues next time, or convert them into a registered account.

  9. #9
    azwarian is offline Junior Member
    Join Date
    Aug 2008
    Posts
    11

    Default

    DELETE FROM CustomerWHERE IsRegistered = 0

    I guess we have a winner

    Thanks for the help Jao, I really appreciate it a lot!