Monday, October 08, 2012

Microsoft SQL Failover Partner

Connection String
The SQL Native Client data providers introduced a new connection string keyword to support some of the new features in SQL Server 2005. The failover partner keyword is used to specify the second partner of the database mirroring session in the connection string. SQL Native Client connects to whichever server is the principal at the time the connection is made.

Following is an example connection string:

Data Source=SQLA\INST1;Failover Partner=SQLB\INST1;Initial Catalog=DBMTest;Integrated Security=True

For more information on connection attributes when using SQL Native Client with ADO.NET, OLE DB, and ODBC, see Using Connection String Keywords with SQL Native Client in SQL Server 2005 Books Online.

The syntax of the failover partner keyword is slightly different from one connection method to another:

  • OLE DB: FailoverPartner (no space between “Failover” and “Partner”)
  • ODBC: Failover_Partner (underscore between “Failover” and “Partner”)
  • ADO.NET: Failover Partner (one space between “Failover” and “Partner”)
  • JDBC: failoverPartner (no space between “failover” and “Partner”)

Note: Keywords are not case sensitive. Make sure there is no white space before or after the keyword, before or after the semi-colons, and before or after the equal to operator in the connection string.

Source: http://technet.microsoft.com/en-us/library/cc917713.aspx#EDAA

No comments: