What does LSN mean in SQL Server?

Every record in the SQL Server transaction log is uniquely identified by a log sequence number (LSN). LSNs are ordered such that if LSN2 is greater than LSN1, the change described by the log record referred to by LSN2 occurred after the change described by the log record LSN.

From here.

You should not be concerned with how these are generated.


There is no guaranteed way to derive it, but you can guess it from msdb.dbo.backupset on the machine you did the backup on:

SELECT  last_lsn
FROM    msdb.dbo.backupset
WHERE   backup_start_date = @backup_date

This is of course not exact and not reliable.


It is an increasing sequence (1,2,3,4,...), not a date time value. From the Microsoft documentation:

The log sequence number (LSN) value is a three-part, uniquely incrementing value. It is used for maintaining the sequence of the transaction log records in the database. This allows SQL Server to maintain the ACID properties and to perform appropriate recovery actions.


First of all, sorry for replying on dead post. I came to this thread while searching other operations based on LSN. LSN is nothing but sequential number, as it specifies - Log Sequence Number generated in three hexadecimal parts like 00000016:0000003c:0001 and these parts are as below:

  • First part is VLF : Virtual Log Files
  • Second/Middle part is OffSet : Offset to the VLF
  • Last/Third part is Slot Number inside the block of log/bucket traced based on offset

Generally any DB operation along with start/end of transaction would be stored and each operation of the transaction, obviously with start and commit operation would get LSN in sequential order. Those are not related to any timestamp but can be mapped with timestamp based on sys function. @max has already replied for that.

Any commit operation towards transaction, force to switch to new log block and middle part would be incremented, otherwise last part would be increased based on the size of VLF.