Link to home
Start Free TrialLog in
Avatar of PtboGiser
PtboGiserFlag for Canada

asked on

SQL Update - Update Table from 2 others

Hey Guys
I am looking to update my Parcel Table from the Segment & Street Table using and update trigger.
If Street_Full_Name is updated in Street table
Then update the Parcel Table, Small Catch (Subquery?)

Within the Parcel Table it only holds Segment_ID. Segment_ID is updated manually depending on Parcel locations.
Street_Full_Name is updated in Segment using the following Query
UPDATE Segment
SET Segment.street_Full_Name = st.street_Full_Name,
	from dbo.Street st
                INNER JOIN INSERTED i ON st.OID = i.OID
                INNER JOIN dbo.Segment s ON s.Street_ID = st.Street_ID

Open in new window

Segment connects to Street using the Street_ID
Parcel does not have the Street_ID, It has Segment_ID.
So how do i connect Parcel to Street(which is the base source for the Street_Name_Full column) Using the Segment_ID held in Segment.
3 table join type thing
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
On what table is the trigger?
Avatar of PtboGiser

ASKER

thx, i was thinking to complex. Friday afternoon!!!