SQL Server Profiler - watch for permission denied on objects?

SqlRyan picture SqlRyan · Jun 26, 2009 · Viewed 8.8k times · Source

I'm using SQL Profiler to watch some database activity, and I'm interested in watching "Permission Denied" for various objects in the database. There are about 50 different items in the "Security Audit" category, but none that seem to display "Permission denied" for an object. I can see Login Failed, and a few other failures, but nothing on the object level.

Example: A user has permission to a database, but not on a particular table. When they attempt to select from that table, they'll receive an error - can I have profiler watch for these errors?

Answer

Mike Forman picture Mike Forman · Jun 26, 2009

You want to capture the "User Error Message" event in the "Errors and Warnings" section. You can filter the Error column as you see fit. Error 229 is permission denied