I am off to learning triggers and the first one I am having an issue with. If I update 1 row, this works fine, however if I update more than one row only the last row updates. How do I get this to update all of the rows that were affected?
CREATE trigger TimeRetrieve
on trig
for update
as
if update (update1)
begin
declare @PK as int
select @PK = ID from inserted
update trig set times = getdate() where ID = @PK
end
Billy Ballard
For in the past, Lies the future.
CREATE trigger TimeRetrieve
on trig
for update
as
if update (update1)
begin
declare @PK as int
select @PK = ID from inserted
update trig set times = getdate() where ID = @PK
end
Billy Ballard
For in the past, Lies the future.