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 comman开发者_如何学God
You need to change your connecction string to connect to the new principal.
There are two main ways to do this:
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.
Change the connection string either manually or on a failover, to use the failover server's details directly.
精彩评论