views:

28

answers:

1

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

+1  A: 

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.

Bravax
What is the connection string and how to change it?? Iam new to this topic please give some example...
Have a look at this thread: http://stackoverflow.com/questions/677678/how-to-add-failover-partner-to-a-connection-string-in-vb-net
Bravax