Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Auditing Through Triggers Expand / Collapse
Author
Message
Posted Friday, January 11, 2002 12:00 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, November 05, 2013 9:05 AM
Points: 976, Visits: 59
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/rmarda/auditingtriggers.asp



Robert W. Marda
SQL Programmer
Ipreo
Post #2198
Posted Sunday, January 13, 2002 8:14 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 31, 2007 8:20 AM
Points: 885, Visits: 1
Hi

Only problem we had is where programmers with retrieving the identity of the inserted row, but they kept retrieving the audit tables identity column instead, so we had to remove this identity column from the audit table and rely on date/time and user combination (no p-key on the audit table). Have you experienced this before?

Also, TEXT columns can not be audited unless you use INSTEAD-OF triggers which is a right pain in the you know what.

Cheers

Chris




Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
Post #26245
Posted Monday, January 14, 2002 5:28 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: Moderators
Last Login: Today @ 7:39 AM
Points: 6,705, Visits: 1,677
With SQL2K Scope_Identity() solves those issues - I agree it was a pain and a MAJOR source of bugs if someone added a trigger that inserted to another table with identity column after the fact. Another option is to use a unique identifier for the audit primary key if you prefer/like a contrived key.

On text cols...guess it depends how important it is! I use instead of triggers in some places, in others it is non-critical data and I just don't audit.


Andy


Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Post #26246
Posted Monday, January 14, 2002 5:15 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 31, 2007 8:20 AM
Points: 885, Visits: 1
Hi Andy

Thanks Andy, also found an article on it and will give it a burl. Ill have to be more thorough in reading up on the new features.

Cheers

Chris




Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
Post #26247
Posted Thursday, January 24, 2002 3:54 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, November 05, 2013 9:05 AM
Points: 976, Visits: 59
I never had a problem with the identity columns. I think this is because we didn't use them a lot where I used to work (Telos Corporation).

Robert Marda




Robert W. Marda
SQL Programmer
Ipreo
Post #26248
Posted Friday, January 16, 2004 6:31 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, March 15, 2007 9:22 AM
Points: 238, Visits: 1

The only issue I have with this approach is it makes one assumption. Each user in the organization has a network sign on. Where I currently work (today is my last day) the network admin refuses to give everyone network signons. He knows at some point we have to have auditing of changes and I have told him this is the best approach. But he refuses to do so. Since the application we developed has unique signons for each user we could do something with that but it makes it harder.

Having network signons is usually a good assumption to make but not always.

Ross




Post #95677
Posted Thursday, January 22, 2004 7:51 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, July 05, 2005 5:57 AM
Points: 1, Visits: 1

I'm currently building a security administrator app and I have a process where when a user's info is updated, the permissions table is also updated.  I send in the UserID that is doing the update into the stored procedure. My question is can the trigger read the "Updated By UserID" param or would I have to have a column in the UserInfo table get updated by the UserID param and then the trigger would get the UserInfo:Updated By UserID column?

Thanks, Lucas




Post #96610
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse