Here is the script to find out what was the last restored LSN in any database, particularly i more used in Log-Shipping. This is one of my favourate script to finding the last LSN.
Select redo_start_lsn from sys.master_files where
database_id = db_id('SecondaryDatabaseName') and type = 0
The output would be like below:-
As per the above LSN you can easily find out what will be the next Transaction log you have to restore. You can even use above script for recovering mode database.
You have any questions or thanks or critics feel to leave a comment.lsn, logshipping, log-shipping. logshipping. logsiping. transaction log. restore last lsn, lsn mismatch. lsn number. lsn in sql server. sql server lsn. sql server lsn number. sql server lsn no. restore lsn no.