bclick
Grasshopper
Points: 18
More actions
April 22, 2003 at 10:39 am
#357754
Hello -
Looking for code for a simple trigger to copy one field to another field in the same table, on insert.
Thanks much.
Steve Jones - SSC Editor
SSC Guru
Points: 734459
April 22, 2003 at 10:54 am
#454934
create trigger mytrigger for insert on mytable
update mytable
set field2 = i.field1
from inserted i
where i.mypk = mytable.mypk
Steve Jones
sjones@sqlservercentral.com
http://www.sqlservercentral.com/columnists/sjones
http://www.dkranch.net
April 22, 2003 at 12:03 pm
#454947
Hey, that works! Thanks for your quick response Steve.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply