user186246
user186246

Reputation: 1877

How can I connect to a principal database when a failover occurs in SQL server 2005?

How can I connect to a principal database when a failover occurs in SQL server 2005 using TSQL.....after failover a pricipal database becomes mirror but still how can i connect to the new pricipal using SQL command

Upvotes: 0

Views: 153

Answers (1)

Bravax
Bravax

Reputation: 10483

You need to change your connecction string to connect to the new principal.

There are two main ways to do this:

  1. Include the failover details in the first connection string, so the system will attempt to the original principal, fail to connect and then try the failover.

  2. Change the connection string either manually or on a failover, to use the failover server's details directly.

Upvotes: 1

Related Questions