Solved

How do I do this using a trigger?

Posted on 1998-12-08
2
156 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
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

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…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.

828 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