Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3959468
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:44:02+00:00 2026-05-20T02:44:02+00:00

Is there a way to update a record in an audit table (via triggers)

  • 0

Is there a way to update a record in an audit table (via triggers) without that record being locked due to the update which fired the trigger was inside a transaction.

So we have a Users table and a trigger that fires on insert, update, delete and logs the changed values to some Audit table, however i do not want the audit table to be locked preventing other triggers from firing which do actions on the audit table.

edit: just to clarify, the issue I have is that multiple tables report to the same audit table via different triggers, so an update to one table locks all the other tables from being updated. As for the concerns about what if transactions roll back, this is not such a concern as the audit table is there just for change tracking and if the record rolls back it is not an issue if the audit table does not roll back.

I have thought of a way it might work but I do not know if this is possible (or how to do it), is there a way have a trigger use a new connection instead of the one that was initially called?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T02:44:03+00:00Added an answer on May 20, 2026 at 2:44 am

    It is impossible to create an action that does not at least place a write lock on the record/page being written. SQL Server would otherwise have consistency issues all the time. You should be looking from the opposite angle – the other processes that need to access the audit table (audit normally means read only with little to no update) should use

    SET TRANSACTION ISOLATION LEVEL SNAPSHOT
    or
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
    

    Which will dirty-read (or versioned without locking) from the audit table

    If you must..

    There is a sneaky way to isolate the write from the transaction using Service Broker by instead inserting data to an intermediate table and having the SSSB asychronous activation thread write the audit record for you, allowing your original long running transaction to remain uncommitted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to easily/elegantly update multiple columns in a table with record
There is a way that MySQL to check record which is going to INSERT
Is there way to update a record after something has been rendered without putting
Is there any way to update instance variables from a page method without making
Is there a way to update only the parent UpdatePanel without updating the child
Is there any way to update a table layout after it has been created?
hIs there any way to update all the columns of a mysql table for
Is there any way to update cookies across folders in PHP? For example, consider
Is there a way to update more than one Database having same schema using
Is there a way to update information in a div of a parent page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.