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 7552205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:42:07+00:00 2026-05-30T10:42:07+00:00

I want to trigger an update on a specifc column, when changed. (history: some

  • 0

I want to trigger an update on a specifc column, when changed.

(history: some application does an update on a column, and I cant find what app. Therefore I decieded to make a trigger to force back the value).

To make it simple..

UsrTbl:
usrid usr   pwd
1001  admin qwerty
2001  cto   demo
3001  ceo   demo
...

if someone makes an update on pwd where usr is admin, I want to re-update it to specific value.

If i do a trigger, something like:

CREATE TRIGGER the_usr_trg ON usrtbl AFTER UPDATE AS
UPDATE usrtbl SET pwd='qwerty' WHERE usr = 'admin'
GO

Will above fix this for me?
What happen when the trigger updates the column? will it fire the_usr_trg trigger again ? will this cause a loop in the database server? or will it run once only?
Is there better approach to fix this? (other than finding what app is updating this column:)

Thank you!

  • 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-30T10:42:08+00:00Added an answer on May 30, 2026 at 10:42 am

    I believe that it will depend on the recursion level for triggers that is on the DB. If the RECURSIVE_TRIGGERS is setted to OFF, then it will be run only once. In your case, think that it would be better if you create an INSTEAD OF trigger, thus avoiding the first UPDATE on your table. In your case it would be something like this:

    CREATE TRIGGER the_usr_trg ON usrtbl 
    INSTEAD OF UPDATE 
    AS
    BEGIN
    
        UPDATE A
        SET pwd= B.pwd
        FROM usrtbl A
        INNER JOIN INSERTED B
            ON A.usr = B.usr
        WHERE usr != 'admin'
    
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have DB table with update trigger (to track history of changes). I want
So I want to trigger an event (pausing/unpausing some media) whenever the user presses
We are using Task in our application. In one class we want to trigger
I just want an update trigger like this postgresql version... It seems to me
MySQL: In update trigger's body, can I obtain the value of a column that
I want to list down the queries executed before the 'AFTER UPDATE TRIGGER' triggered
I am new to triggers and want to create a trigger on an update
I want to trigger an event that causes the ScrollPane to start scrolling up
I want to trigger a hyperlink by hitting Enter using jQuery. I have the
I want to trigger a special action in the save() method of a Django

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.