Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 trigger?

Author  Topic 

lynk666
Starting Member

2 Posts

Posted - 2007-06-06 : 07:52:35

would anyone be able to help me with a simple generic template that updates the date in a table?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-06-06 : 08:14:14
[code]
create trigger tu_table1 on table1 for update as
begin
update t
set datecol = getdate()
from inserted i inner join table1 t
on i.pk = t.pk
end
[/code]



KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-09 : 06:55:13
Did you read it in sql server help file?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -