use master
go
CREATE proc rp_switch_rec_model
(@MODE varchar(20))
as
Declare
sdb_namecurs cursor for
select name from master..sysdatabases where name <> 'TEMPDB';
open sdb_namecurs;
declare @db_name sysname
fetch next from sdb_namecurs into @db_name;
While @@fetch_status = 0
Begin
exec('ALTER DATABASE ' + @db_name + ' SET RECOVERY ' + @MODE)
--print 'ALTER DATABASE ' + @db_name + ' SET RECOVERY ' + @MODE
fetch next from sdb_namecurs into @db_name
End
Deallocate sdb_namecurs
GO
-- USAGE
exec rp_switch_rec_model 'SIMPLE'
-- OR
exec rp_switch_rec_model 'FULL'
-- OR
exec rp_switch_rec_model 'BULK_LOGGED'
Rubal Jain // Email - Rubal @ Rubal [dot] Net
Windows Server Setup, Configuration, Troubleshooting, Basic Security & Hardening
DotNetPanel - Helm Control Panel Setup, Installation, Configuration, Troubleshooting
Authorised DNP Reseller. Get 20% Discount on all DNP Licenses.
Authorised SmarterTools, Declude, SimpleDNS (JHSoft), Gene6 FTP, Helicon, Kayako, Icewarp Merak, MailEnable, Deerfield Reseller.
DotNetPanel & SmarterTools Monthly Leased Licenses available.
DotNetPanel Professional Server setup includes installation of PHP, Perl, Python, ASP.Net Frameworks, SQL Express, MySQL, SmarterMail, Stats etc and complete integration with control panel just $199/server. Contact for further details.