Showing posts with label master database. Show all posts
Showing posts with label master database. Show all posts

Thursday, August 2, 2012

Database Restore History

USE msdb;
GO
Select top 20
DBRestored= destination_database_name,
SourceFile= physical_name,
RestoreDate= restore_date
from RestoreHistory h
inner join BackupSet b
on h.backup_set_id = b.backup_set_id
inner join BackupFile f
on f.backup_set_id = b.backup_set_id
order by RestoreDate desc
GO

MvM

Monday, July 23, 2012

List Recovery Model for all databases in SQL Server 2000

Two ways I used to find it. But the best one is the first one listed.




SELECT Name,

DATABASEPROPERTYEX (Name,'RECOVERY') AS [Recovery Model]

FROM master.dbo.sysdatabases

OR


sp_msforeachdb

'use [?] select ''?'' as DatabaseName, DATABASEPROPERTYEX(N''?'', N''RECOVERY'')'


MvM