SQLism

Logging and Blogging SQL Server Experiences.

Wednesday, June 7, 2017

T SQL query to find when was the database backed up lastly on SQL Server

Select database_name As [Database Name]
, [name] As [Backup Name]
, Case When Type = 'D' Then 'Full Backup'
When Type = 'I' Then 'Differential Backup'
When Type = 'L' Then 'Log Backup'
Else 'File or filegroup or partial'
End As [Backup Type]
, Recovery_Model
, [backup_start_date] As [Time of the SQL Backup Job]
FROM [msdb].[dbo].[backupset]
Posted by SQLism at 9:44 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: agent, backed, database, database backup, find, history, lastly, Query, recovery model, SQL, SQL Server, T, the, to, up, was, when
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ►  2020 (6)
    • ►  July (1)
    • ►  March (1)
    • ►  February (4)
  • ►  2018 (3)
    • ►  August (3)
  • ▼  2017 (10)
    • ►  December (1)
    • ►  October (1)
    • ▼  June (1)
      • T SQL query to find when was the database backed u...
    • ►  May (1)
    • ►  February (4)
    • ►  January (2)
  • ►  2016 (7)
    • ►  December (1)
    • ►  November (3)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
  • ►  2015 (10)
    • ►  September (1)
    • ►  April (9)
  • ►  2014 (53)
    • ►  October (19)
    • ►  September (33)
    • ►  June (1)
  • ►  2013 (12)
    • ►  October (2)
    • ►  September (1)
    • ►  August (5)
    • ►  July (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2012 (9)
    • ►  September (1)
    • ►  August (6)
    • ►  July (2)
Simple theme. Theme images by luoman. Powered by Blogger.