Recently I’d been asked to increase the partner timeout of all the mirrored databases on an instance. There were many databases on this instance so I decided to use the undocumented feature sp_MSforeachdb instead. This system stored procedure returns all the databases, including system ones, for the instance.
EXECUTE master.sys.sp_MSforeachdb ‘ALTER DATABASE [?] SET PARTNER TIMEOUT 120’
Increase mirroring partner timeout