Monday, January 28, 2013 1:04 PM
I need to find last transaction log backup history using T-SQL, how can i do that?
Monday, January 28, 2013 1:08 PMSelect * from msdb.dbo.backupset where type ='L' This query will return all log backups information, if you want any particular database try this Select * from msdb.dbo.backupset where type ='L' and database_name = <<your database name>>
Hope it Helps!!
Monday, January 28, 2013 1:20 PM
You can use,
SELECT bs.backup_start_date, bs.backup_finish_date, * FROM msdb..backupfile bf JOIN msdb..backupset bs ON bf.backup_set_id = bs.backup_set_id WHERE bf.File_Type = 'L'
select database_name, max(backup_finish_date) from msdb..backupset where type = 'L' group by database_name
Following forum thread might be helpful also
Please help and appreciate others by using these features: "Propose As Answer", "Vote As Helpful" and "Mark As Answer"
MS(SPM), MS(E&F),M.Engg, MCP, MCT, MCTS, MCITP, MCSE, MCPD, MCSD, MCDBA , Author
Linked In: http://www.linkedin.com/in/waqasm1