Quote:
Originally Posted by englere
This is an update to the above SQL. Instead of deleting ALL anonymous users, it might be better to delete only the ones who haven't returned to your site in the last 60 days (or 30, or whatever number you like):
delete from aspnet_profile
where userid in
(select userid from aspnet_users
where isanonymous = 1
and datediff(dd, LastActivityDate, getdate()) > 60)
go
delete from aspnet_users
where isanonymous = 1
and datediff(dd, LastActivityDate, getdate()) > 60
go
Eric
|
See the stored procedure dbo.aspnet_Profile_DeleteProfiles
and Class ProfileManager e.g. ProfileManager.DeleteInactiveProfiles