[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I do this using a trigger?

Posted on 1998-12-08
2
Medium Priority
?
160 Views
Last Modified: 2010-03-19
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
Comment
Question by:RBertora
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Victor Spiridonov earned 400 total points
ID: 1092124
create tr_ins_a trigger
on tableA
for update
if update(field1)
insert into tableB (field3,field4)
SELECT field1,getdate()
FROM inserted
0
 
LVL 7

Author Comment

by:RBertora
ID: 1092125
Looks good,
thanks dude.
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question