+ Reply to Thread
Results 1 to 3 of 3
  1. Senior Member
    Join Date
    Apr 2010
    Posts
    7,363
    #1

    Default After Update Triggers

    I'm working in a data warehouse that has an application resting on it. There are some functionality to the app which allows users to make changes. Some of these changes are used for auditing and KPI metrics.

    I want to set getdate / timestamp values in the last update date with the after update triggers.

    I have a staging environment I can test in. Just wondering if there are any one offs or gotcha I should be aware of? We have the columns already captured in the tables, so on a few of these tables I wanted to start to track the last update date. I may set a trigger to capture the user who made the update as well. (But since it's coming from a C# application I am not sure if that will track the user profile or some other generic id produced from the front end).
    Reply With Quote Quote  

  2. SS -->
  3. Achieve excellence daily
    Join Date
    May 2012
    Location
    Washington State
    Posts
    1,341

    Certifications
    CISSP
    #2
    Just make sure you very carefully test your trigger to ensure it works the way you want for all operations and re-updates. I have used triggers in both production and staging environments and have found that sometimes they can be a performance implication. It's not intuitive but you'll be referencing the INSERTED table to get any values that have changed in your UPDATE trigger.
    When you go the extra mile, there's no traffic.
    Reply With Quote Quote  

  4. Senior Member
    Join Date
    Apr 2010
    Posts
    7,363
    #3
    Hehehe that was a wild goose chase.

    So I queried the set and didn't see any updates to that column, and I didn't see any triggers set or assemblies. I assumed that their wasn't a after update trigger on those fields. Well I guess the application is controlling the input for the after insert times. I did end up finding out that there were a few records in there that had been updated.

    I found several shops control inputs from the application not the database. I'm starting to think this is common practice.
    Reply With Quote Quote  

+ Reply to Thread

Social Networking & Bookmarks