This topic is relevant only for databases that are using the full or bulk-logged recovery models.
SQL Server 2005 and later versions let you use a log sequence number (LSN) to define the recovery point for a restore operation. This is a specialized feature that is intended for tools vendors and is unlikely to be generally useful.
By using a RESTORE statement, you can stop at or immediately before the LSN, as follows:
Typically, a specific transaction is selected to be included or excluded. Although not required, in practice, the specified log record is a transaction-commit record.
For more information about how to use LSNs, see Log Sequence Numbers and Restore Planning.
For more information about point-in-time restores, see Restoring a Database to a Point Within a Backup.
The following example assumes that the AdventureWorks database has been changed to use the full recovery model.
AdventureWorks
RESTORE LOG AdventureWorks FROM DISK = 'c:\adventureworks_log.bak' WITH STOPATMARK = 'lsn:15000000040000037' GO