Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table View Record

Status
Not open for further replies.

cpaige

Programmer
Jun 19, 2000
86
0
0
CA
Hi,
Is there some way I can write code that will execute everytime a table is read?
Thanks,

Clayton T. Paige
claytonpaige@yahoo.ca

Programmer Extraordinaire

========================================================

"Who is General Failure? and Why is he reading my disk drive?"
 
Here's a very clumsy solution, i hope someone comes up with something better. I had to do this in a development system to catch people browsing user-info tables... Would definitely avoid this solution anywhere but development machines.

Start profiler with output going to a table, filtering on TextData, ExecutionPlan, or anything else that would tell you that the table is being read.

Create a trigger on the profiler output table with your code.

 
Another option depends on the permissions of your users. If they don't have sysadmin or db_owner permissions, you can DENY SELECT permission on the table and then write a stored procedure to do selecting on that table. You can log whatever you want in the stored procedure.


“I apologize for this long letter. I didn't have the time to make it any shorter” --Blaise Pascal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top