Changing Your SQL Server Login Name
To change a username in SQL Server Management Studio, you connect to the server, open the Security folder, right-click the login you want to rename, select Rename, type the new name, and press Enter. The change takes effect when ready, but anyone using that login will need to update their connection settings to use the new name.
This process works the same way whether you are managing a local server or a remote one. The key is that you must have administrative permissions on the SQL Server instance — a standard user account cannot rename logins, even their own.
Key Takeaways
- You need to be logged in as a system administrator or someone with ALTER ANY LOGIN permission to rename a login in SQL Server Management Studio.
- The rename happens in the Security folder under the server name, not in individual database settings.
- After you rename a login, any process or person using that login must update their connection string or saved credentials to use the new name.
- Renaming a login does not affect the permissions that login already has — those stay attached to the new name.
- If you rename a login that owns a schema or database, you may need to update the owner separately depending on your SQL Server version.
Step-by-Step: Renaming a Login
Open SQL Server Management Studio and connect to the server where the login exists. In the Object Explorer panel on the left, expand the server name by clicking the arrow next to it.
Expand the Security folder. You will see a Logins subfolder — click the arrow next to it to see all the logins on that server. Find the login name you want to change in the list.
Right-click the login name and select Rename from the menu. The name will become editable — it will highlight and show a text cursor. Type the new name you want to use, then press Enter. SQL Server will confirm the change, and the login list will update to show the new name.
Close the rename dialog if one appears. The change is complete and takes effect right away.
What Happens to Permissions After a Rename
When you rename a login, all the permissions that login held stay with it under the new name. If the login had permission to access a specific database, create tables, or run stored procedures, those permissions do not disappear — they straightforward transfer to the new login name.
The same is true for role membership. If the login was a member of the sysadmin server role or a database role, it remains a member under its new name. You do not have to re-grant anything.
However, if that login owns a schema or is listed as the owner of a database, you may need to update the owner separately. Some SQL Server versions handle this automatically during the rename, but others do not. If you see an error message about ownership during the rename, you will need to change the owner through the database properties or schema properties after the rename is complete.
Updating Applications and Connection Strings
After you rename a login, any process, script, or person trying to connect using the old login name will fail with an authentication error. You must update every place that stores or uses that login name.
Check process configuration files, connection strings in code, scheduled jobs, linked servers, and any saved connections in SQL Server Management Studio itself. If you have SSMS shortcuts or saved server connections that use the old login name, edit them to use the new one.
If you have SQL Server Agent jobs that run under that login, open each job and update the job owner or the credentials it uses. Replication subscriptions, database mail profiles, and any other features tied to that login will also need updating.
Renaming a Windows Domain Login
If the login you are renaming is a Windows domain account (it will show a name like DOMAIN\username in the login list), the process is the same in SQL Server Management Studio. However, the actual Windows account name is controlled by your domain administrator, not by SQL Server.
If you rename the Windows account in Active Directory, SQL Server will not automatically update the login name to match. You will still need to rename the login in SQL Server Management Studio as described above. Conversely, if you rename the login in SQL Server but not the Windows account, the login will no longer work because SQL Server will not find a matching Windows account to authenticate against.
To avoid confusion, coordinate with your domain administrator before renaming a Windows login. Rename the account in Active Directory first, then rename the corresponding login in SQL Server Management Studio to match.
If You Cannot Find the Login to Rename
If you open the Security folder and do not see the Logins subfolder, or if you see Logins but it is empty or does not show the login you are looking for, check your permissions first. You must be connected as a system administrator or someone with ALTER ANY LOGIN permission. If you are not, ask your database administrator to make the change or to grant you the necessary permission.
If you are logged in with the right permissions but still cannot see the login, verify that you are connected to the correct server. SQL Server Management Studio can connect to multiple servers at once, and the Object Explorer shows each one separately. Make sure you are expanding the right server name in the tree.
If the login exists but you still cannot see it, try refreshing the Object Explorer. Right-click the Logins folder and select Refresh, or press F5. If it still does not appear, the login may have been deleted, or there may be a display issue — try closing and reopening SQL Server Management Studio.
Renaming Your Own Login
You can rename your own login using the same steps, but be aware that after the rename takes effect, your current connection will remain open. You will not be logged out when ready. However, the next time you try to connect to SQL Server using SQL Server Management Studio or any other tool, you must use the new login name.
Before you rename your own login, make sure at least one other system administrator account exists on the server. If you rename your only admin account and then make a mistake, you may lock yourself out of the server. After the rename, test the new login by opening a new connection in SQL Server Management Studio to confirm it works.
Frequently Asked Questions
Can I rename a login that is currently connected to the server?
Yes, you can rename a login even if someone is actively using it. The person using that login will not be disconnected, but they will not be able to create new connections with the old name. Their current session will continue until they disconnect or the connection times out.
What if I rename a login by mistake and need to change it back?
You can rename it again using the same process. Right-click the login, select Rename, and type the original name. As long as no other login already has that name, the rename will succeed. If another login now has that name, you will need to rename the other login first.
Does renaming a login affect the databases that login can access?
No. The login's access to databases and its permissions within those databases remain unchanged. The rename only changes the name you use to connect — it does not alter what that login is allowed to do once connected.
Can I rename a login through a script instead of the GUI?
Yes. You can use the T-SQL command sp_renamelogin or ALTER LOGIN depending on your SQL Server version. For example: ALTER LOGIN [oldname] WITH NAME = [newname]. You must still have ALTER ANY LOGIN permission, and the same rules about updating applications and connection strings explore.
What happens if two logins have the same name?
SQL Server does not allow two logins with the same name on the same server. If you try to rename a login to a name that already exists, you will get an error and the rename will fail. You must choose a unique name.