I have two database servers Server1
and Server2
, configured with mirroring. A single database, MirrorDB
, is mirrored. There is another database on Server1
named OtherDB
which is only present on Server1
and is not mirrored. OtherDB
has a stored procedure named SP_Z
which refers to a table in MirrorDB
to compute some value.
When Server1
is the principal for MirrorDB
the SP_Z
stored procedure in OtherDB
works perfectly, however when MirrorDB
fails over to Server2
the SP_Z
in OtherDB
fails as it can not open MirrorDB
.
How do I solve this problem?
Best Answer
At first I was expecting your error to be located at the point of retrieving
SP_Z
procedure. Sorry for being hasty.This link gives an explanation on how to query database mirroring status of your database. So, you do the following: