MSSQL Find WHO Deleted_Created Table

 use Test01

GO

--select * from fn_dblog(null,null)

--Who Created Table

select [Begin Time],[Transaction Name],[Transaction SID] from 

fn_dblog(null,null) where [Transaction Name] = 'CREATE TABLE'

--who Dropped Table

select [Begin Time],[Transaction Name],[Transaction SID] from 

fn_dblog(null,null) where [Transaction Name] = 'DROPOBJ'

--who inserted Data

select [Begin Time],[Transaction Name],[Transaction SID] from 

fn_dblog(null,null) where [Transaction Name] = 'INSERT'

--who Deleted Data

select [Begin Time],[Transaction Name],[Transaction SID] from 

fn_dblog(null,null) where [Transaction Name] = 'DELETE'

--who Updated Data

select [Begin Time],[Transaction Name],[Transaction SID] from 

fn_dblog(null,null) where [Transaction Name] = 'UPDAT



Once got [Transaction SID]

Now RUN following Query:

use master

GO

select SUSER_SNAME(Transaction SID)

Example:

use master

GO

select SUSER_SNAME(0x0105000000000005150000007CEB240DDA16EB2307E53B2BF0BC0100)

Comments

Popular posts from this blog

SQL Server – How to re-initialize just a single article in transaction replication

SQL Deadlock Report - Extended Events

DBA Daily Commands in Handy