4

I have a virtual machine that was built by our IT department to host various processes. They named the computer something incomprehensible like "XYSVC105" and I am not allowed to change it. I have also installed MS SQL Server 2014 on this machine and everything is working great.

However, I have been searching for MS best practices but cannot seem to find if you are able to change the name of the SQL Server to be different than the host computer or if it's recommended not to do it. I would like to change the SQL Server name to something like "OPSRES".

Most of the reasons for this are internal. One of them being that this will be used by a multitude of users and developers. From experience they will remember a simple name like OPSRES and not XYZ145PPQ.

4

I have been searching for MS best practices but cannot seem to find if you are able to change the name of the SQL Server to be different than the host computer or if it's recommended not to do it.

If you installed default instance then your sql server name will be hostname XYSVC105.

If you installed named instance e.g. sql01 then your sql server name will be XYSVC105\sql01.

Below are few ways that you can use to have your application connect to the name you wish e.g. OPSRES.

I would like to change the SQL Server name to something like "OPSRES".

You can create an alias and have your client applications use that in connection string.

Also, since you are using sql server 2014 - if you are using AlwaysOn Availablity group then you can just use listener (its a virtual network name (VNN) or Virutal IP (VIP)) and have your application use listener instead of host names.

You can even ask your DNS Admin to create Hostname Alias for a SQL Server Instance

  • Does not work in SSMS – TomTom Jun 17 '18 at 18:46
1

Yes, the names can be different and you are able to change the sql server name. One of the simplest examples would be if you set up SQL Server and rename Windows Server afterwards - OS name and SQL name will be different as the SQL Server name (select @@servername) is set as a part of installation process.

If you need to change the sql server name, you can use:

exec master.sys.sp_dropserver @servername = 'XYSVC105'
exec master.sys.sp_addserver @server = 'OPSRES', @local = 'LOCAL'

You will also need to perform SQL service restart after that

I did not come across situations where different names would actually cause an issue, but I have used it on several occasions in ~100 subscribers replication setup to clean things up and help the administration tasks.

1

If you have access to DNS, you can create a CNAME record to point to your SQL server and name the CNAME anything you want. If you don't have access to DNS, then you can ask the IT people to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.