Sql Server Fn Dblog

[Solved] Sql Server Fn Dblog | Php - Code Explorer | yomemimo.com
Question : sql server fn_dblog

Answered by : henry-petersen

DECLARE @TableName sysname
SET @TableName = 'dbo.tableName'
SELECT u.[name] AS UserName , l.[Begin Time] AS TransactionStartTime
FROM fn_dblog(NULL, NULL) l
INNER JOIN ( SELECT [Transaction ID] FROM fn_dblog(NULL, NULL) WHERE AllocUnitName LIKE @TableName + '%' AND Operation = 'LOP_DELETE_ROWS' ) deletes
ON deletes.[Transaction ID] = l.[Transaction ID]
INNER JOIN sysusers u
ON u.[sid] = l.[Transaction SID]

Source : | Last Update : Thu, 26 May 22

Answers related to sql server fn dblog

Code Explorer Popular Question For Php