Re: Audit logging an adp



Merlin wrote:
Some people may be tempted to suggest using SQL Server triggers, so I'll jump in early and say they won't help me for these reasons:
* All connections to the SQL Server are done through a single account, so I can't get the user ID of the person making the change; and

If the application can call SET CONTEXT_INFO after opening a database connection (for example calling a stored procedure which calls SET CONTEXT_INFO), then you can pass in any username you like (or any other piece of data up to 128 bytes total) and it will remain local to the database connection. The triggers can read this data and store whatever value you pass in as the user ID.

* Most of the tables contain NText and Text fields that will need to be auditted, and the triggers don't let you see the value of fields of that type


INSTEAD OF triggers will.

I sell a SQL Server audit product which automatically creates audit triggers for you, including the SET CONTEXT_INFO stuff. It audits TEXT/NTEXT/IMAGE fields but only to the degree as described previously by David (it captures the changed value...you have to look at the previous audit to get the "before" value). Implementing an INSTEAD OF trigger option is on the todo list.

Steve Troxell
http://www.krell-software.com/omniaudit
.



Relevant Pages

  • Re: Audit logging an adp
    ... Allen Browne's audit code. ... Some people may be tempted to suggest using SQL Server triggers, ... but without an adequate security model your audit trail ...
    (microsoft.public.access.adp.sqlserver)
  • Re: One Web Service updates SQL, another cant?
    ... Columnist, SQL Server Professional ... I guess its because this is my first Web Service and I ... it opens the database connection. ... >>> In the profiler, in the Events tab, click on Security Audit. ...
    (microsoft.public.sqlserver.security)
  • Re: One Web Service updates SQL, another cant?
    ... > Columnist, SQL Server Professional ... I guess its because this is my first Web Service and I ... it opens the database connection. ... >> In the profiler, in the Events tab, click on Security Audit. ...
    (microsoft.public.sqlserver.security)
  • Re: Viewing SQl transacion logs...
    ... However, as you can imagine, the overhead to maintain an audit ... we are converting to SQL server, if they were already keepijng those audit ... >> whether or not the change was part of a transaction? ... > triggers on any table to create an audit trail. ...
    (microsoft.public.sqlserver.odbc)
  • Re: Try Catch Finally
    ... The sp_reset_connection stored procedure is used by SQL Server to support remote stored procedure calls in a transaction. ... This stored procedure also causes Audit Login and Audit Logout events to fire when a connection is reused from a connection pool. ...
    (microsoft.public.de.german.entwickler.dotnet.vb)

Quantcast