Rename instance of SQL Server

Use the following to identify the name of the SQL Server
select @@servername

To change the name of the SQL Server instance:
sp_dropserver 'OldSqlName'
go

sp_addserver 'NewSqlName', local
go

Be sure to RESTART the SQL Server service.
-Easiest way is to right-click on the server in the Object Explorer in SQL Management Studio and select 'restart' from the pop-up menu.

None of this is likely to work with an Azure instance of SQL Server.

Last modified by Mohit @ 4/5/2025 8:09:58 PM