Log table access using SQL Server Profiler

后端 未结 4 722
轮回少年
轮回少年 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:18

    It may help to investigate the locks SQL is acquiring. Select statements will generally aquire shared Locks (LCKMS), so you can filter for this.

    In profiler look for the Locks:Acquired event. The ObjectID will resolve to the table which you can easily lookup with OBJECT_NAME(objectid). The Mode will tell you the kind of lock being acquired shared locks are 3. For more information look here.

提交回复
热议问题