SQL Server View System log

Source: Internet
Author: User
Tags system log

Transferred from: http://bbs.csdn.net/topics/390903317

--step #1:
Use [Lowescampms.net_test]
GO
SELECT
[Transaction ID],
Operation,
Context,
Allocunitname

From
Fn_dblog (null, NULL)
WHERE
Operation = ' Lop_delete_rows ' and
Allocunitname= ' dbo. Vehicle.pk_vehicle '
--here ' dbo. Test.pk__test__5f573dd6 ' refers to the pk_name of the name of the table
--You can use Sp_pkeys SourceTableName to find


--step #2:
SELECT
Operation,
[Transaction ID],
[Begin time],
[Transaction Name],
[Transaction SID]
From
Fn_dblog (null, NULL)
WHERE
[Transaction id] = ' 0000:0010847e '--here ' 0000:0005afba ' means step #1中的Transaction ID
and
[Operation] = ' lop_begin_xact '

--step #3:
Use MASTER
GO
SELECT suser_sname (0x01) ' UserID '--here ' 0000:0005AFBA ' value step #2中的Transaction SID

SQL Server View System log

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.