Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server fn_dblog

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]
Comment

PREVIOUS NEXT
Code Example
Sql :: mysqli_free_result 
Sql :: sql server obtener nombre sin espacios en blanco 
Sql :: compress sql file database ubuntu 
Sql :: postgres between dates 
Sql :: execution order in sql 
Sql :: show sql property syntax for jpa. 
Sql :: sql field equals multiple values 
Sql :: how to show current database in mysql 
Sql :: Host ' is not allowed to connect to this MySQL server 
Sql :: check if user defined table type exists in sql server 
Sql :: cascade syntax in sql 
Sql :: sql insert into select statement 
Sql :: mysql uuid 
Sql :: json_modify sql server 
Sql :: create column that already exists mysql 
Sql :: how to declare variable date in mysql 
Sql :: merge command in sql 
Sql :: postgresql show tables 
Sql :: Order of execution SQL or MySql query Or Logical order of operations: 
Sql :: violation of primary key constraint 
Sql :: Ms Sql set us timezone 
Sql :: mysql trim characters 
Sql :: PG::ForeignKeyViolation: ERROR: update or delete on table violates foreign key constraint 
Sql :: cast in sql server 
Sql :: sql ssrs 
Sql :: select in select sql 
Sql :: sql create table as 
Sql :: les jointures sql server 
Sql :: what is between operator 
Sql :: create view in oracle sql 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =