Re: writing audit trail for a table

From: Sa (ksadf_at_sdkaew.org)
Date: 02/28/05


Date: Mon, 28 Feb 2005 15:00:38 +0800

Thanks, Aaron.

That's what I guess. I just wondering is there a better way to do. It is
because there are many fields in the table.

"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:BE4805E9.15FD%ten.xoc@dnartreb.noraa...
> I think you would have to compare the before values (in the deleted table)
> to the after values (in the inserted table).
>
>
>
>
> On 2/27/05 11:15 PM, in article usfYWwUHFHA.1476@TK2MSFTNGP09.phx.gbl,
"Sa"
> <ksadf@sdkaew.org> wrote:
>
> > Hello Experts,
> >
> > I am using SQL Server 2000 (SP3). May I ask you a question regarding
> > programming in SQL Server?
> >
> > I have an "Opportunity" table (more than 30 fields with various data
type)
> > and an "AuditTrail" table. Whenever there is an update action to one or
> > more fields in the "Opportunity" table, I have to record each old value
and
> > new value in the "AuditTrail".
> >
> > Is that the commo approach is using "UPDATE" trigger in the
"Opportunity"
> > table?
> > Is there anyway I can know which field(s) will be updated in the
> > "Opportunity" table? Thus, I do not need to compare the old value and
new
> > value for each field in the "Opportunity" table?
> > Is there any sample code?
> >
> > Would you please give me some hints and suggestions? Thank you very
much!!
> >
> > Sa
> >
> >
>



Relevant Pages

  • Re: writing audit trail for a table
    ... I think you would have to compare the before values ... > programming in SQL Server? ... > Is there any sample code? ... > Would you please give me some hints and suggestions? ...
    (microsoft.public.sqlserver.programming)
  • Please consider.
    ... programming of MS SQL server 2005, configuration of routers (NAT, ... Managed and supported databases MS SQL server 2005, ... Created web sites navigation structure and contents. ...
    (rec.photo.digital)
  • Please correct my English.
    ... programming of MS SQL server 2005, configuration of routers (NAT, ... Managed and supported databases MS SQL server 2005, ... Created web sites navigation structure and contents. ...
    (alt.usage.english)
  • Re: Need help writing a query
    ... I remember way back when, when I was a student myself, and also worked as ... an assistant teacher in programming. ... the ideal solution, and I knew that his girlfriend was taking the same ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • RE: Possible to toggle Updatable<->Read-Only record
    ... prevent other users thinking they have timed out. ... The only way to make this more secure is to have a piece of middle ware ... people viewing/editing the same record (from SQL Server) keep overwriting ... What I was thinking was programming the "Save" button to add a JobInUse=1, ...
    (microsoft.public.dotnet.languages.csharp)