-- To rename a computer that hosts a stand-alone instance of SQL Server
-- For a renamed computer that hosts a default instance of SQL Server, run the following procedures:
EXEC sp_dropserver <old_name>
GO
EXEC sp_addserver <new_name>, LOCAL
GO
-- Restart the instance of SQL Server.
-- For a renamed computer that hosts a named instance of SQL Server, run the following procedures:
EXEC sp_dropserver <'old_name\instancename'>
GO
EXEC sp_addserver <'new_name\instancename'>, LOCAL
GO
-- Restart the instance of SQL Server.