How to rename SQL Server after server cloning?

1,  Execute the below commands for each instance on the machine.
-- for a Default Instance
sp_dropserver 
GO
sp_addserver , local
GO

--for a Named Instance
sp_dropserver <'old_physical_server_name\instancename'>
GO
sp_addserver <'new_name\instancename'>, local
GO
2, Restart the SQL Server services.

3, Execute the below query in each instance to verify the updated system metadata.
SELECT @@SERVERNAME

Add Comment