Take the tour ×  When MSSQL DB Mirroring fails over, our script
won't login, fails on:  Cannot open database requested by the
login. The login failed. Login failed for user ...  The way I
can fix this is by running:  EXEC sp_change_users_login
'Auto_Fix', 'MyUsername', NULL, 'MyPassword'  How can I sort
this so logins just work automatically?  share|improve this
question add comment  3 Answers  up vote 1 down vote accepted
Found out we need to recreate the logins on the mirror server
with the same SID.   share|improve this answer Just to add, this
works. –  Igor K Apr 9 '11 at 15:34 add comment  Robert Davis is
the author of the only DBM book and is a MCM. Try the below if
it helps.   share|improve this answer add comment  Another
solution could be to rely on domain accounts, where the SIDs are
managed by the domain, rather than sql server accounts, where
the default SIDs are instance-specific.  share|improve this
answer add comment  Your Answer