Find DataBase Backup Modes

,

This is just a quick method to determine the backup mode of all databases on a server.  No cursor involed.

use master
go
if exists (select 1 from tempdb.dbo.sysobjects where name like '%dbmode%' and type = 'u')
begin
	drop table ##dbmode
end
create table ##dbmode (
	DBName	varchar(60),
	Mode	sql_variant)
set	nocount on
exec master.dbo.sp_msforeachdb 
"USE [?]
insert	##dbmode
SELECT	db_name(),DATABASEPROPERTYEX('?', 'Recovery')
" 
select * From ##dbmode
order by dbname

Rate

2 (1)

Share

Share

Rate

2 (1)