You are here: Home >Posts Tagged ‘SQL Backup and Restore

SQL SERVER – Attach mdf file without ldf file in Database

Background Story: One of my friends recently called up and asked me if I had spare time to look at his database and give him a performance tuning advice. Because I had some free time to help him out, I said yes. I asked him to send me the details of his database structure and [...]

Tags: , , , , , , , , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

SQL SERVER – Finding Last Backup Time for All Database

Here is the quick script I use find last backup time for all the database in my server instance. SELECT sdb.Name AS DatabaseName, COALESCE(CONVERT(VARCHAR(12), MAX(bus.backup_finish_date), 101),’-') AS LastBackUpTime FROM sys.sysdatabases sdb LEFT OUTER JOIN msdb.dbo.backupset bus ON bus.database_name = sdb.name GROUP BY sdb.Name DatabaseName LastBackUpTime Master 04/03/2011 MSDB 04/03/2011

Tags: , , , , , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS