If the SQL Server has the Remote Logins, then at the time of changing the SQL Server name you will receive below error.
Server: Msg 15190, Level 16, State 1, Procedure sp_dropserver, Line 44 There are still remote logins for the server 'SERVER A'
This is because some remote logins are present on the server and they are not allowed to modify the Server name in System metadata. To solve this problem, first you need to drop these remote logins. In order to drop these logins, please follow below procedure.
- If the SQL server instance is default instance. Please run below query.
sp_dropremotelogin old_name; GO
2. If the SQL Server Instance is Named instance, then please run below query.
sp_dropremotelogin old_name\instancename; Go
After removal of all remote logins you can easily rename the SQL Server using below queries.
- If the server hosts the default instance of SQL Server then, execute below queries.
sp_dropserver <old_name>; GO sp_addserver <new_name>, local; GO
To get these changes effective you need to restart the SQL Services.
2. If the server hosts the named instance of SQL Server then, execute below queries.
sp_dropserver <old_name\instancename>; GO sp_addserver <new_name\instancename>, local; GO
To get these changes effective you need to restart the SQL Services.
2 Comments »