Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want insert specific row from table 1 to table 2 before update, i write this query but its not working,

SQL
CREATE TRIGGER [CarTriggerUpdateDelete]
ON [Cars]
BEFORE OF UPDATE
AS
BEGIN
    UPDATE Cars SET 
      Car_No = 5224,
      Car_shs = 12316354312
    FROM Cars AS t
    INNER JOIN CarTriggerUpdateDelete AS i
    ON t.Car_id = i.Car_id
	where t.Car_id = 6666
END
GO


What I have tried:

How i use Trigger before update in sql server
Posted
Updated 8-Aug-16 23:30pm

1 solution

If you get an error message you don't understand, google the error: this is because the table has a foreign key with cascading delete or update - Google Search[^]
As you can see, you aren't the first to have this problem, and that google will take you straight to the solution: Solving the SQL Server Multiple Cascade Path Issue with a Trigger[^] a lot, lot quicker than asking here...
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900