mssql current lsn
https://dba.stackexchange.com/questions/48705/sql-server-transaction-log-backups-test-whether-tail-log-follows-last-known-log
WITH LSN_CTE
AS
(
SELECT TOP 1
LEFT( LogRecords.[Current LSN], 8 ) AS Part1,
SUBSTRING( LogRecords.[Current LSN], 10, 8 ) AS Part2,
RIGHT( LogRecords.[Current LSN], 4 ) AS Part3
FROM sys.fn_dblog(NULL,NULL) AS LogRecords
ORDER BY [Current LSN]
)
SELECT CAST( CAST( CONVERT( varbinary, Part1, 2 ) AS int ) AS varchar ) +
RIGHT( '0000000000' + CAST( CAST( CONVERT( varbinary, Part2, 2 ) AS int ) AS varchar ), 10 ) +
RIGHT( '00000' + CAST( CAST( CONVERT( varbinary, Part3, 2 ) AS int ) AS varchar ), 5 ) AS [Converted LSN]
FROM LSN_CTE
https://www.sqlskills.com/blogs/paul/using-fn_dblog-fn_dump_dblog-and-restoring-with-stopbeforemark-to-an-lsn/
https://solutioncenter.apexsql.com/ru/%D1%87%D1%82%D0%B5%D0%BD%D0%B8%D0%B5-%D0%B6%D1%83%D1%80%D0%BD%D0%B0%D0%BB%D0%B0-%D1%82%D1%80%D0%B0%D0%BD%D0%B7%D0%B0%D0%BA%D1%86%D0%B8%D0%B9-sql-server/
https://technet.microsoft.com/ru-ru/library/ms180892(v=sql.105).aspx
https://technet.microsoft.com/ru-ru/library/ms179355(v=sql.105).aspx