Specifying Faiover partner in OpenRowset

  • We have a database,which has been mirrored.Also,We have an application which uses OpenRowSet to connect to this database.

    Is it possible to set "Failover partner" in OpenRowSet connection string,so when we failover from Prinicple server to the mirrored database,The application still will continue to work?

    Example:

    select

    *

    from openrowset(

    'SQLOLEDB',

    'Data Source=Server1;Failover Partner=Server2;trusted_connection=yes;','select top 10 from Database1.dbo.Table1'

    ) temp

  • I know this post is old but in case some else is looking for an answer this works for me:

    select

    *

    from openrowset( 'SQLNCLI','Provider=SQLNCLI; 'DataSource=Server1;FailoverPartner=Server2;Database=MyDB;trusted_connection=yes;','select top 10 from Database1.dbo.Table1'

    ) temp

    MG

    "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
    Tony Hoare

    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply