I want to update a table in a trigger, fired after an insert. I'm trying to get the following working ...
ALTER TRIGGER [dbo].[name]
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
UPDATE table set
table.startdate = S.enddate
table.enddate = DATEADD(d,CAST(S.Q/S.V as int),S.Enddate)
Inserted AS I INNER JOIN Stable as S
In short: take the enddate from a row in table s, do some math with it to get a new enddate.
What is the solution?