delete guest account

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 3 años
hi
i'm using Nop 4.2 and i found i have around 600,000 guest account in database . i try to delete it by Maintenance page but every time get crashing error page.
is there is save way to delete this accounts ?
thanks
Hace 3 años
You could run SQL Query

DELETE Customer
FROM Customer
LEFT OUTER JOIN [Order] ON Customer.Id = [Order].CustomerId
WHERE ([Order].Id IS NULL) AND (Customer.Email IS NULL)
Hace 3 años
Hello
also find this table in database with same row number "Customer_CustomerRole_Mapping" i need ur advice about delete related row with Customer table
Hace 3 años
Actually in the database there is a DeleteGuests stored procedure
You can Execute that stored procedure which will cover all requirments
Hace 3 años
thank you
correct i see the Stored Procedures in DB and get this error when execute it

Error -2147217904
  
Procedure or function 'DeleteGuests' expects parameter '@CreatedFromUtc', which was not supplied.

EXEC DeleteGuests;

did i wrote the command not correctly?
Hace 3 años
Yes it has some parameters - you can use this query to execute it

USE [nopCommerce43]
GO

DECLARE  @return_value int,
    @TotalRecordsDeleted int

EXEC  @return_value = [dbo].[DeleteGuests]
    @OnlyWithoutShoppingCart = True,
    @CreatedFromUtc = NULL,
    @CreatedToUtc = NULL,
    @TotalRecordsDeleted = @TotalRecordsDeleted OUTPUT

SELECT  @TotalRecordsDeleted as N'@TotalRecordsDeleted'

SELECT  'Return Value' = @return_value

GO
Hace 1 año
Yidna wrote:
Yes it has some parameters - you can use this query to execute it

USE [nopCommerce43]
GO

DECLARE  @return_value int,
    @TotalRecordsDeleted int

EXEC  @return_value = [dbo].[DeleteGuests]
    @OnlyWithoutShoppingCart = True,
    @CreatedFromUtc = NULL,
    @CreatedToUtc = NULL,
    @TotalRecordsDeleted = @TotalRecordsDeleted OUTPUT

SELECT  @TotalRecordsDeleted as N'@TotalRecordsDeleted'

SELECT  'Return Value' = @return_value

GO

thank you it was life saving!
Hace 1 año
hi
i'm using Nop 4.3 and i have around 700,000 guest account in database . i try to delete it by by stored procedure then website stuck till the records deleted.
is there is save way to delete this accounts ?
thanks
Hace 1 año
gkashyup wrote:
hi
i'm using Nop 4.3 and i have around 700,000 guest account in database . i try to delete it by by stored procedure then website stuck till the records deleted.
is there is save way to delete this accounts ?
thanks

Try deleting them manually in admin area > system > maintenance. Please see the "Deleting guest customers" block. But do not delete all records at once. Specify some different periods of time (e.g. one month)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.