Friday, October 29, 2010

INSTEAD OF TRIGGER


create
table test (id
intime
int identity (1,1) , datetime,outtime datetime)
 create trigger testtrigger on testinstead of update as begindeclare @outtime datetime
select @outtime = intime from insertedupdate test set outtime = @outtimeend

insert test (intime) values (GETDATE())
update
test set intime = getdate()where id = 1

select
* from test

No comments:

Post a Comment