SQL Server Update Trigger for "last modified" date
I may need this soon - so here's an example of the syntax.
Using a trigger to manitain a last modified date for a table.
select 'create trigger ' name '_updatedate on ' name ' for update not for replication
as
update ' name ' set update_date = getdate()
where id in (select id from inserted)
'
from sysobjects where type = 'u'
Microsoft SQL Server - Creating a Date Updated Field in Tables - SQLTeam.com: "select 'create trigger ' name '_updatedate on ' name ' for update not for replication
as
update ' name ' set update_date = getdate()
where id in (select id from inserted)
'
from sysobjects where type = 'u'"
Posted 5:07 PM
|
0 comments
|
Permalink