145 pts.
0
Q:
Transaction Log - SQL Server 2005
How do i find out what transaction log file was last applied to a database?
ASKED: Jun 16 2009  4:11 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
47070 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Which backups have been restored is kept in the msdb database. Look in the database for tables that start with backup or restore. That's where the information is kept. You can also look in the ERRORLOG file as each restore should be logged in there.
Last Answered: Jun 17 2009  3:17 AM GMT by Mrdenny   47070 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Hydra   145 pts.  |   Jun 23 2009  6:19PM GMT

what i want to do is pull the last lsn number applied to the database to view with a tsql statement, is there a way to do that? And also i want to pull the lsn to view from the transaction log using tsql

 

Hydra   145 pts.  |   Jun 23 2009  8:06PM GMT

Thanks Mr. Denny, I used the msdb.
select bs.backup_start_date,
bs.first_lsn,
bs.last_lsn,
bs.checkpoint_lsn
from dbo.backupset bs
where bs.database_name = ‘YourDatabaseNameHere’
and bs.backup_set_id > (select max(backup_set_id) from dbo.backupset where database_name = bs.database_name and type = ‘D’)

 
0