How to Find Instance Name for Availability Group Listener? I was recently asked this by DBA at  Comprehensive Database Performance Health Check. Well, the question is very valid if you are familiar with how Availability Group Listener works.
If you are connected to an Availability Group listener, the name displayed in Object Explorer and Properties may be different from what your instance name is actually. In this case, you may have to just use the T-SQL for the same.
Here is the T-SQL for the same.
SELECT @@Servername
Once you run the command above, it will give you a different server name from the Availability Group Listener name. Well, that’s it for today. What do you think of this small but very important blog post?
If you liked this blog, please do not forget to subscribe to my YouTube Channel – SQL in Sixty Seconds.
Here are my few recent videos and I would like to know what is your feedback about them.
- Read Only Tables – Is it Possible? – SQL in Sixty Seconds #179
- One Scan for 3 Count Sum – SQL in Sixty Seconds #178
- SUM(1) vs COUNT(1) Performance Battle – SQL in Sixty Seconds #177
- COUNT(*) and COUNT(1): Performance Battle – SQL in Sixty Seconds #176
- COUNT(*) and Index – SQL in Sixty Seconds #175
- Index Scans – Good or Bad? – SQL in Sixty Seconds #174
- Optimize for Ad Hoc Workloads – SQL in Sixty Seconds #173
- Avoid Join Hints – SQL in Sixty Seconds #172
- One Query Many Plans – SQL in Sixty Seconds #171
Reference:Â Pinal Dave (http://blog.SQLAuthority.com)