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

asked on

Update Trigger

I would like to pull the Street_Full_Name and AnnoName columns from my Street Table Where StreetID in the Segment Table = StreetId in the Street Table when there has been a insertion or Update on my Street.
AS well i will need it to fire or a separate Trigger to fire when there has been and insertion or Update on the Segment table
How best to handle something like ?
Segment Table Trigger(which is not working)
ALTER TRIGGER [dbo].[FName_AName_Num_Las<wbr ></wbr>tdate_Cont<wbr ></wbr>_Segment] ON [dbo].[Segment]
    AFTER INSERT, UPDATE
AS
    BEGIN
        SET NOCOUNT ON;

       UPDATE Segment
        SET     Street_Full_Name = st.Street_Full_Name,
                AnnoName = st.AnnoName
        FROM    dbo.Segment s
                INNER JOIN INSERTED i ON s.OID = i.OID
                INNER JOIN dbo.Street st ON s.Street_ID = st.Street_ID

    END

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada 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
Avatar of PtboGiser

ASKER

I've requested that this question be deleted for the following reason:

thx