Log table access using SQL Server Profiler

后端 未结 4 726
轮回少年
轮回少年 2020-12-19 11:08

Is there a way to use Profiler to determine whether a table is being accessed by queries?

I saw an event named Object:Opened (Indicates when an object h

4条回答
  •  温柔的废话
    2020-12-19 11:17

    There is a way to do that with Profiler, but it's got a heck of a performance impact.

    Instead, can you clarify your question with the version of SQL Server you're using? If you're using SQL Server 2008, look into the Audit object, which is designed to do exactly that, plus it's got a very low performance impact.

    Here's an article explaining how to set up an audit:

    Implementing Security Audits in SQL Server 2008

    Other posters have noted that you can filter TextData on object name, but that doesn't work if someone uses a view to access the object.

提交回复
热议问题