Asp.net 会员 2.0。
我想更新表 aspnet_user 中的用户名,最好的方法是直接更新表。
UPDATE aspnet_Users SET UserName = @UserName,LoweredUserName = LOWER( @UserName)
WHERE UserName = @CurrentUname
如何确保它是唯一的?
谢谢,
更新: If not exist (select UserName from aspnet_Users)
Begin
UPDATE aspnet_Users SET UserName = @UserName,LoweredUserName = LOWER( @UserName)
WHERE UserName = @CurrentUname
End
如何修改上面的代码?
第二次更新:
If not exist (select UserName from aspnet_Users WHERE UserName = @CurrentUname)
Begin
UPDATE aspnet_Users SET UserName = @UserName,LoweredUserName = LOWER( @UserName)
WHERE UserName = @CurrentUname
End
SELECT 1;
else
select 0;