SELECT UserID FROM Users WHERE UserID > 470
DELETE
FROM dbo.aspnet_Membership
WHERE UserId IN
(
SELECT u.UserId
FROM dbo.aspnet_Users u
INNER JOIN dbo.aspnet_Applications a ON u.ApplicationId = a.ApplicationId
INNER JOIN Users U1 On U1.UserName = u.LoweredUserName
WHERE LOWER(0) = a.LoweredApplicationName
AND U1.UserID > 470
)
--- Repeat for tables aspnet_UsersInRoles, aspnetaspnet_Profile, aspnet_Users
--- and finally
DELETE FROM dbo.Users WHERE UserID > 470
Do more with
Premium Content
You need an Expert Office subscription to comment.Start Free Trial