Rename SQL 2008 R2 logon account

Hi,

Anyone knows how is it possible to rename an user logon name

I hace a user account in sql.  "Johnn" and I would like to rename to "jonh"

is it possible ?

I am not able to find references to do it.
projectjaAsked:
Who is Participating?
 
ZberteocConnect With a Mentor Commented:
All the logins are under that Security>Login node in MS. They are all the same. To rename a login just expand the Security>Logins node and locate the one you want to change and right click on it and then Rename. If you don't have the right to do that you will get an error message.

If it is a windows account with windows authentication then make sure you keep the domain part:

DOMAIN\
0
 
YZlatCommented:
use ALTER USER
0
 
YZlatCommented:
try

ALTER USER Johnn WITH NAME = John;
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
projectjaAuthor Commented:
Hi,

Thanks for your reply

I get "Msg 15151, Level 16, State 1, Line 2
Cannot alter the user 'nagios', because it does not exist or you do not have permission"

I am using sa user to do it.
0
 
YZlatCommented:
ALTER LOGIN Johnn WITH NAME = John;
0
 
YZlatCommented:
oh, and you need to have sufficient permissions to run these
0
 
YZlatCommented:
you need to be an admin
0
 
YZlatCommented:
is it a user or a login? If a login, use ALTER LOGIN I provided above.
0
 
Vijaya Reddy Pinnapa ReddyCommented:
Check this msdn document, explained clear, how and what are permissions required to alter the user name,

http://msdn.microsoft.com/en-us/library/ms176060.aspx
0
 
projectjaAuthor Commented:
It is a Security Login.
paint-security-login.png
0
 
YZlatCommented:
The use ALTER Login

Are you logged in as an admin?
0
 
projectjaAuthor Commented:
Sorry for the delay.

Yeah, Zberteoc, It worked at the first trying. That was I needed.

Perfect.

thanks to all for your help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.