Archive for May, 2008

SQL tracing is nice to find out details about several issues. But there is no out-of-the-box solution to enable tracing for a user, only for session- or system-wide tracing. But there’s a trick to close this gap. It’s old, but stil useful: Use a logon trigger to enable tracing for all sessions of a user (or for all users except x, y and z). And use a logoff trigger to disable tracing again.

Here’s some code how one might want to do a logon trigger for all users except system users and within a specific time window: