Thursday 5 May 2011

DotNetNuke Not Uniq Emails

Sometimes clients ask to make registration at the site with uniq emails only. It somehow prevents to appear duplicates of the users. But sometimes site is live already and have a lot of registered users, then it needs to find all users with not uniq emails in DB and to fix. It is possible with query like this:

SELECT UserID, UserName, FirstName, LastName, Email, DisplayName
FROM {databaseOwner}{objectQualifier}Users
WHERE Email IN
(
SELECT Email
FROM {databaseOwner}{objectQualifier}Users
GROUP BY Email
HAVING COUNT(Email)>1
);

Hope this helps!

No comments:

Post a Comment

Note: only a member of this blog may post a comment.