• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

How do I do this using a trigger?

2 tables A& B both with two fields.

A : Field1 varchar ,Field2 varchar
B : Field3 varchar ,Field4 datetime

upon updating TableA a new entry must be made in TableB:

Field3 of TableB must passed the new updated value of field1 in TableA.

Field4 must be timestamped now.

Please provide me with detailed syntax, ie
try it out in ISQL before posting an answer

Thanks.
Bert.
0
RBertora
Asked:
RBertora
1 Solution
 
Victor SpiridonovCommented:
create tr_ins_a trigger
on tableA
for update
if update(field1)
insert into tableB (field3,field4)
SELECT field1,getdate()
FROM inserted
0
 
RBertoraAuthor Commented:
Looks good,
thanks dude.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now