Is there a difference? I am after the name of the server, even if it’s running on an instance.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
HOST_NAME()is the name of the client. So if you retrieve the value from SSMS on your workstation it will be the name of your workstation, while if you run the command from SSMS on the server, it will be the name of the server.Also if the server is clustered, do you want the virtual SQL Server name or the physical name of the currently active node? If the latter you’ll want: