Reading the SQL Server Log file – and undocumented command
1 2 3 4 5 6 7 8 9 10 11 12 |
SELECT [Current LSN], [Operation], [Transaction ID], [Parent Transaction ID], [Begin Time], [Transaction Name], [Transaction SID], [Lock Information], [Description] FROM fn_dblog(NULL, NULL) WHERE [Operation] IN ('LOP_BEGIN_XACT', 'LOP_COMMIT_XACT', 'LOP_MODIFY_ROW', 'LOP_DELETE_ROWS', 'LOB_INSERT_ROWS') |
to get all the column, execute this:
1 2 3 |
SELECT TOP 100 * FROM fn_dblog(NULL, NULL) ORDER BY [Current LSN] DESC |
Here is a blog post by Paul Randal: Using fn_dblog, fn_dump_dblog, and restoring with STOPBEFOREMARK to an LSN
Views – 3948