I have two database servers A and B where I have databases set up in mirroring namely X. There is another database on server A named Y which is only present on database server A. Y database has a stored procedure SP_Z which refers one table from database X to compute some value.
When database X on server A is in principle mode the SP_Z stored procedure in database Y works perfectly but when database X from server A trips and goes down in mirrored mode and database X on server B becomes principle database the SP_Z in Y database fails as it can not find database X.
How do I solve this problem? I understand the question is presented in complicated manner. Feel free to edit.