.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT
Post New Web Links

Audit Trail

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

In my MySql Table I need to keep track of all the changes, especially create,update, and delete changes each record. I need to keep track of who did
what changes.

This is MySQL Create table Query

create table quotes(QuoteNumber int(15) ,Revision timestamp,Vendor varchar(45),
PartNumber varchar(60),Status varchar(20),Customer varchar(45),
Requestor varchar(20),X varchar(20),Xin varchar(10),Y varchar(20),Yin varchar(10),Layers Varchar(20),
BlindVia varchar(20),Impedence varchar(20))

How can i implement the Audit trail to above table.Please help me,Thanks.

View Complete Post

More Related Resource Links

Stay Alert: Use Managed Code To Generate A Secure Audit Trail


In today's security-conscious environments, a reliable audit trail is a valuable forensic tool The Windows Server 2003 operating system provides features that let you enable a wide range of applications to make use of auditing functionality. This article looks at auditing from the operating system perspective and describes a sample managed code implementation that will allow you to add auditing to your own server applications.

Mark Novak

MSDN Magazine October 2005

Generic Implementation of Audit Trail

I want to create a generic audit trail of my database in which I can store new/old values of fields. Now problem is that in most of the samples they create triggers which are specific to table and column. How can I implement a generic audit trail in Oracle.What I mean by generic is that there might be some SP and tables which I can add to any Oracle Database and system will start logging tables. I wont mind if I have to define triggers on every table for insert/delete/update but Code in all triggers should be same and not specific to that table. Can anyone help me out. Thanks in advance to all who will help me

Audit trail using logging block


Hi All,

I need to implement audit trail in my whole asp.net application. When a record get created, changed or deleted, i need to do an entry in database about username, datetime stamp, old and new record.

Can you please guide me on how to implement it at asp.net application level.

Should i use Microsoft Enterprise library logging block for this, as somebody told me that logging block will automatically create database table with all the entries i want.

Can somebody please verify whether all the columns i mention above will be catered by logging block.



Need help with Audit Trail


I have a public function that i want to use for audit trail. I do not know where to put this function. i tried to put it in the masterpage but when i call the function out in the other aspx pages, it says that the function is not declared.

Thanks in advance. Any help is gladly appreciated.

SSRS Audit Trail Security Issue


One of my reports has tight security issues that come with it. I have integrated windows authentication so that the logged in user's credentials are passwed as a parameter to the stored procedure that is called. That parameter is marked as HIDDEN, which works perfectly for ad-hoc calls by end users to the report.

My security loophole seems to come in when the end user schedules a subscription. The "user id" parameter is then no longer hidden and the end user can schedule the report to run with any other user's id that they wish to.

If the subscription is still in the system I can read the Subscriptions table and see that "Bob" has asked for the report to run as though it is really "Sam." But the problem is if they remove that subscription, the ExecutionLog records the fact that the report was run for "Bob" as the parameter, but it runs under the admin account of course, and there is no record (that I can find) of who the report was emailed to.

Is there a way I can find out who reports were emailed to when they were executed as subscriptions?

Toolbox: Database Audit Logs, Joel on Software, Code Handouts, and More


This month the Toolbox column takes a look at database logging, Joel Spolsky's blog, printing code projects, and ASP.NET reading.

Scott Mitchell

MSDN Magazine May 2008

Data Points: Creating Audit Tables, Invoking COM Objects, and More


Dealing with error handling between T-SQL and a calling application, evaluating when a field's value has changed, and creating auditing tables in SQL ServerT are all common issues that developers must tackle.

John Papa

MSDN Magazine April 2004

Implementation of Audit Fields and optimistic concurrency

What is the best way to implement Optimistic concurrency? Also, I have 4 audit columns in every table in my database. They are created date, updated date, created by, updated by. Application should populate these fields. I want to know how to populate created date , and updated date? From where application datetime or database datetime? On save button click, if I have to save data into 4 different tables, then I need to have same datetime in all 4 audit fields correct? What is the best way to implement this? What will be the design? Please let me know.  

Generic Audit Trigger CLR C#(Works when the trigger is attached to any Table)

This Audit Trigger is Generic (i.e. non-"Table Specific") attach it to any tabel and it should work.  Be sure and create the 'Audit' table first though. The following code write audit entries to a Table called'Audit' with columns 'ActionType'    //varchar'TableName'    //varchar'PK'    //varchar'FieldName'    //varchar'OldValue'    //varchar'NewValue'    //varchar'ChangeDateTime'    //datetime'ChangeBy'    //varchar using System;using System.Data;using System.Data.SqlClient;using Microsoft.SqlServer.Server; public partial class Triggers{//A Generic Trigger for Insert, Update and Delete Actions on any Table[Microsoft.SqlServer.Server.SqlTrigger(Name = "AuditTrigger", Event = "FOR INSERT, UPDATE, DELETE")] public static void AuditTrigger(){SqlTriggerContext tcontext = SqlContext.TriggerContext; //Trigger Contextstring TName; //Where we store the Altered Table's Namestring User; //Where we will store the Database UsernameDataRow iRow; //DataRow to hold the inserted valuesDataRow dRow; //DataRow to how the deleted/overwritten valuesDataRow aRow; //Audit DataRow to build our Audit entry withstring PKString; //Will temporarily store the Primary Key Column Names and Values hereusing (SqlConnection conn = new SqlConnection("context connection=true"))//Our Connection{conn.Open();//Open the Connection//Build the AuditAdapter an

SQL Audit: What operations are captured within DATABASE_OBJECT_ACCESS_GROUP?

What operations are captured in DATABASE_OBJECT_ACCESS_GROUP? I expected create/drop certificate/symmetric key is captured. But nothing is captured after I followed these steps: CREATE DATABASE DB1, Configure and enable Server and Database Audit Specs which includes (only) DATABASE_OBJECT_ACCESS_GROUP (in both Specs). Then execute the following T-SQL Script.   USE DB1 GO CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'P@ssw0rd!' GO CREATE CERTIFICATE MyDBCert WITH SUBJECT = 'My Database Certificate' GO CREATE SYMMETRIC KEY MySymKey WITH ALGORITHM = TRIPLE_DES ENCRYPTION BY CERTIFICATE MyDBCert GO CREATE TABLE T1 (ID nvarchar(3), C1 nvarchar(50)) GO -------------------------------------------------------------- OPEN SYMMETRIC KEY MySymKey DECRYPTION BY CERTIFICATE MyDBCert DECLARE @I INT SET @I = 100 WHILE @I <> 0 BEGIN INSERT INTO T1(ID) VALUES(@I) SET @I = @I -1 END GO -------------------------------------------------------------- UPDATE T1 SET C1 = EncryptByKey(Key_GUID('MySymKey'),ID) OPEN SYMMETRIC KEY MySymKey DECRYPTION BY CERTIFICATE MyDBCert SELECT ID, C1, CONVERT(nvarchar, DECRYPTBYKEY(C1)) FROM T1 GO -------------------------------------------------------------- DROP TABLE T1 GO DROP SYMMETRIC KEY MySymKey GO DROP CERTIFICATE MyDBCert GO DROP MASTER KEY GO

Loggin in audit

Is there any audit of users actions in sharepoint. I want to see who, when and from what computer were logged in to the portal.

How list all of the Actions in an MVC application for security audit?

Hi, We are developing a big MVC application and the numbers of published end-points (Controller Actions) -audit properly assigned authorization attributes - are getting out of hand. In WinForms, each aspx file is the end-point, so I can easily audit files and folders. Things in MVC are different.  I am looking for a tool based on reflection that searches actions in all controllers available in the solution and give me a list with assigned [Authorize] attribute. Is such tool or technique available? If such tool is not available, how can I audit the security attack surface of an MVC application? A new developer can easily add an action to a controller class (we have many controllers, can't inspect them manually) and the action become available to public. Thank you, Max

A way to monitor or audit what emails SharePoint sends

Hello, I am looking for a way to track what emails my SharePoint site sends out.  I am currently using workflows for an approval process and would like a way to check to make sure the correct emails have been sent without having to hound down each individual user and confirm through them.  Is there any way to do something like this? Thank you!

Can't find audit log

Hello,i've created Group Work site in Sharepoint 2010, and enabled auditing policy for some document libraries. Problem is, I just can't seem to find where to find this log.Is it logged to trace log, or..?

audit permission changes



We don't have our site collection audit settings enabled.  http://nickgrattan.wordpress.com/2007/11/27/auditing-permission-changes/

Is there another way we can trace to see who modified the permissions on the site such as in the Database, etc?

Thanks in advance....


Time displays in audit logs as GMT

I just played around with setting up SQL Server auditing in 2008 and noticed that the time displays in the audit logs show up as GMT rather than UTC. I'm in CST timezone. I'm wondering if there is a way to change the time in the audit logs to match the OS system time? Thanks!
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend