Renaming Windows Logins in SQL Server after Server or Domain name change

To rename Windows Logins in SQL Server after Server or Domain name change, use this code:

ALTER LOGIN "Old_Server_or_Domain_Name\Windows_Login"
WITH NAME="New_Server_or_Domain_Name\Windows_Login"

Domain logins must be enclosed in brackets.

If you can't login to SQL Server using Windows authentication after Server or Domain name change, and you don't have any logins with sysadmin role that can connect using SQL Server authentication read related blog post:


Access to SQL Server when all administrator accounts are deleted

If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">