Sign In  |  Register
 
 DotNetNuke Powered!
DotNetNuke Support Forums

Update UserNames

Rate this topic:

Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

AuthorMessages
Tigris
Posts:25



08/17/2007 2:27 PM  

How would you go about updating the usernames?

I tried it by updating aspnet_Users and Users tables, but I ran into two problems:

1. I successfully updated the UserName in aspnet_Users but then noticed the LowereUserName field so I thought I'd update it as well, but when I run           UPDATE aspnet_Users SET LoweredUserName =LOWER(UserName) 

I get

Cannot insert duplicate key row in object 'dbo.aspnet_Users' with unique index 'aspnet_Users_Index'.

I have no idea what this means... do I even need this field?

 

2.I created a view that I want to join with table Users and then update the UserName field but when I run

 

UPDATE

Users SET Username = vw_UsersProfileValidAccts.PropertyValue FROM Users INNERJOIN vw_UsersProfileValidAccts ON Users.UserID = vw_UsersProfileValidAccts.UserID

I get

Violation of UNIQUE KEY constraint 'IX_Users'. Cannot insert duplicate key in object 'dbo.Users'.

Any Suggestions?

John Mitchell
Posts:3248



08/17/2007 4:01 PM  

The message means you are trying to update a username to one that already exists.

I think the LoweredUserName field is the one that is actually used, so I would try to keep them in sync.

And you also need to update the Users table, which it looks like you are doing in the second query.

Are you trying to change them to something different based on a property of the profile? If so, then someone may have a value in that property field that is the same as a username that you already have.

tigris7
Posts:18



08/20/2007 4:48 PM  
Yes, I figured out that I was inadvertantly trying to break constraints.

There were duplicated values in the property that I was using to base the new UserNames off of.

I have updated and now have Username and LoweredUserName all in sync.
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.




ActiveForums 3.7
Visit our Store for great DotNetNuke Modules and Skins
DNNMasters Sitemap/Google Sitemap 3.0

Item codeSM3-01
Price$29.00
Product Information 
DotNetNuke CSS NavMenu 3.3 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
Snapsis PageBlaster 3.3.2 for DotNetNuke - Professional Edition

AuthorJohn Mitchell
Base Price$79.00
Product Information 
XDAkuna (Web 2.0 CSS XHTML Skin)

Item codeXDAkuna
AuthorNina Meiers
Price$49.00
Product Information