Build a Hyper-V template w/ SQL Server 2016 pre-installed The problem that I've encountered is in renaming the "template" to the "production" server name. SQL Server sys.servers, server_id =0 retains "template", not "production".

The only way around this seems to be to re-install SQL Server -- defeating the purpose of a template.

Note: sp_addserver has been discontinued; sp_addlinkedserver cannot create server_id =0 (local).
From https://docs.microsoft.com/en-us/sql/database-engine/install-windows/rename-a-computer-that-hosts-a-stand-alone-instance-of-sql-server :

sp_dropserver &lt;old_name&gt;;  
GO  
sp_addserver &lt;new_name&gt;, 'local';
GO  


Restart the instance of SQL Server.

For a named instance:

sp_dropserver &lt;old_name\instancename&gt;;  
GO  
sp_addserver &lt;new_name\instancename&gt;, 'local';
GO  


Restart the instance of SQL Server.

Note you cannot rename the instance part of the name via this method.