By David Postlethwaite
I was at a meeting the other week when someone mentioned that you could specify two SQL Servers in a .NET connection string. I hadn’t heard of this before and did some investigation and found out a bit more.
In your SQL connection string you can specify a second SQL Server – a failover partner. What happens is if the primary server stops responding then your .NET application will automatically start trying to connect to the alternate SQL server.
This is ideal when you are using SQL mirroring, not only will the SQL server failover but your .NET application will failover as well
The syntax is shown below
ConnectionString=”ProviderName= System.Data.SqlClient; Data Source=Server1; Failover Partner= Server2; Initial Catalog=NorthWind ; Integrated Security=True;”