Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Logging Reads

Author  Topic 

Sean_B
Posting Yak Master

111 Posts

Posted - 2009-09-01 : 11:37:02
Hi,

is it possible to keep a log of when a particular table is queried and by which user ?

Sean

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-09-01 : 13:13:04
The only "easy" way I can think of is if your users ONLY have access to the table via a custom application. Obviously then you can build in any logging you want.

Assuming users can directly query the table via Management Studio, Access, etc, then one option would be to keep a profiler trace running on the server. You'd need to monitor the cmdtext output for references to the table. That would be ugly and be a performance hit to as well. (not recommended).

Be One with the Optimizer
TG
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-02 : 03:59:41
Have a look at Dynamic Management Views. Some of them may help you

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Sean_B
Posting Yak Master

111 Posts

Posted - 2009-09-02 : 05:08:10
As the users are supposed to access the data only though stored procedures, I think I'll go down the route of capturing these details in the stored procedures.

Thanks for your input.

Sean
Go to Top of Page
   

- Advertisement -