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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:57:06+00:00 2026-06-15T10:57:06+00:00

This is basically how my database looks like ID | descendant | father |

  • 0

This is basically how my database looks like

ID | descendant | father | mother
---------------------------------
1       X            Y       Z
2       Y            A       B

Letters X,Y,Z,A,B represents some code or number

For example if I change code Y to R in line 1 (ID=1) I would like to change every field where I have code Y to code R or vice versa, if I change Y to R in line 2 so automatically would be change Y to R in line 1

The most important thing is if some code is changed to another, like I sad Y to R or to G whatever, every record in database that has code Y should be changed to R or G.

Could I do that with triggers. Or what other way could be used. (My users has ability to change record via my C# application)

  • 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-06-15T10:57:08+00:00Added an answer on June 15, 2026 at 10:57 am

    Use triggers like this, one for each field:

    CREATE TRIGGER update_descendant
    AFTER UPDATE OF descendant ON MyTable
    BEGIN
        UPDATE MyTable SET descendant = NEW.descendant WHERE descendant = OLD.descendant;
        UPDATE MyTable SET father     = NEW.descendant WHERE father     = OLD.descendant;
        UPDATE MyTable SET mother     = NEW.descendant WHERE mother     = OLD.descendant;
    END;
    

    (If the descendant column is unique, you don’t need to update it.)

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

Sidebar

Related Questions

I am trying to query a database basically so it looks like this: $stmt5
I have one array that contains some settings that looks like basically like this:
My code looks like this: public static synchronized String getPreferenceString(Context context, String key) {
I've got a database that looks like this: ID Name ParentID 1 1 0
I have a database that looks like this: Product: PK(ProductId), ProductName....... Store: PK(StoreId), StoreName......
My Table 'Levels' in a SQL Server 2005 database looks like this: LevelId Description
We have a registration system Database and basically what this query does is check
This code basically translates characters based on position in one string to the character
So basically this code: class A { }; class B { B (const B&
I have a query that looks like this: using (MyDC TheDC = new MyDC())

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.