How To Failover Mutliple Mirroring Databases in SQL Server

preview_player
Показать описание
declare @databasename nvarchar(255)
declare @alldatabases cursor

-- Only select principal databases (mirroring_role).
set @alldatabases = cursor for

-- Execute the failover.
open @alldatabases
fetch next from @alldatabases into @databasename
begin
print @databasename
exec('alter database [' + @databasename + '] set partner failover')
fetch next from @alldatabases into @databasename
end
close @alldatabases
deallocate @alldatabases
Рекомендации по теме
Комментарии
Автор

Is it customised script you pasted there??

dinesh-wxwx