Click here to Skip to main content
13,085,936 members (87,715 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a data base with 4 tables
Table1 has 1 column car
Table2 has 2 columns car,type
Table3 has 3 columns car,type,owner
Table4 has 4 columns car,type,owner,reg
I want to change the value of car column for table 2 3 and 4 when it changes in table 1 and change the value of type column in table 3 and 4 when it changes in table 2
and change the value of owner column in table 4 when it changes in table 3 same when i create a new entry for car I want it to be created in all the below tables
Posted 18-Sep-12 3:26am
Andrei Straut 18-Sep-12 9:33am
This sounds more like a design nightmare.

However, I have once heard of PostgreSQL offering a table inheritance system, you might wanna take a look into it (if you're not limited to a certain RDBMS)

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


You can create after trigger in your code.

Check MSDN Article on SQL Trigger[^]

Trigger will update your corresponding table if the table is updated.

So, you need to create After update trigger on Table1, Table2, Table3.

It will works for you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 18 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100