Sql-server – connection String and Listener

sql server

I am using SQL server 2017, I will like to know how Connection String can be use to talk via Listener to Databases rather talking directly to the DB

Best Answer

Availability Group Listener has a DNS name, for example AG-Listener-01.domain.com

In the connection string, you just specify

Server=AG-Listener-01,1433;Initial Catalog=YourDatabase;User ID=SQLLogin;Password=SQLPassword;
MultiSubnetFailover=True