[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Rename SQL 2008 R2 logon account

Posted on 2012-09-14
12
Medium Priority
?
418 Views
Last Modified: 2012-09-26
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.
0
Comment
Question by:projectja
12 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 38398918
use ALTER USER
0
 
LVL 35

Expert Comment

by:YZlat
ID: 38398923
try

ALTER USER Johnn WITH NAME = John;
0
 

Author Comment

by:projectja
ID: 38398928
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 35

Expert Comment

by:YZlat
ID: 38398936
ALTER LOGIN Johnn WITH NAME = John;
0
 
LVL 35

Expert Comment

by:YZlat
ID: 38398938
oh, and you need to have sufficient permissions to run these
0
 
LVL 35

Expert Comment

by:YZlat
ID: 38398940
you need to be an admin
0
 
LVL 35

Expert Comment

by:YZlat
ID: 38398963
is it a user or a login? If a login, use ALTER LOGIN I provided above.
0
 
LVL 9

Expert Comment

by:Vijaya Reddy Pinnapa Reddy
ID: 38399020
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
 

Author Comment

by:projectja
ID: 38399081
It is a Security Login.
paint-security-login.png
0
 
LVL 35

Expert Comment

by:YZlat
ID: 38399259
The use ALTER Login

Are you logged in as an admin?
0
 
LVL 27

Accepted Solution

by:
Zberteoc earned 1500 total points
ID: 38399327
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
 

Author Comment

by:projectja
ID: 38436169
Sorry for the delay.

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

Perfect.

thanks to all for your help
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question