Solved

How do I do this using a trigger?

Posted on 1998-12-08
2
153 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
2 Comments
 
LVL 7

Accepted Solution

by:
spiridonov earned 100 total points
Comment Utility
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
Comment Utility
Looks good,
thanks dude.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now