Auto update two columns from 2 tables

110 Views Asked by At

Hello I am wondering of there is a way in a SQL server database schema relationship diagram using cascade or something similar which will keep two columns from different tables the same. The pk fk is using part_number. I am wanting the part_description to match in both tables without having to write queries.

dbo.Parts Primary_key part_number part_quantity part_description part_location

dbo.part_numbers Part_number part_description

1

There are 1 best solutions below

5
On

You may create a trigger like this: on updating dbo.Parts table update dbo.part_numbers table and vice versa. Here is a MSDN article about triggers: http://msdn.microsoft.com/en-us/library/ms189799.aspx