Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Triggers

Author  Topic 

victord
Yak Posting Veteran

64 Posts

Posted - 2002-05-27 : 06:08:35
Deal All,
I am trying to write a trigger that will import information from one table to the other. This trigger is meant to fire whenever a specific data is entered into one of the columns in the source table. Could any one help .


Thanks in Advace.
V David

OMB
Yak Posting Veteran

88 Posts

Posted - 2002-05-27 : 06:19:09
Easy Victor

Your old chum here try this:


CREATE TRIGGER triggername ON [your table]
FOR INSERT, UPDATE
AS
BEGIN

if update (your column)


INSERT (Your table 2 (
column1,
column2,
ect....
)
SELECT (
column1,
column2,
etc..)
FROM Inserted


END
go




Hanif



Edited by - omb on 05/27/2002 06:23:07

Edited by - omb on 05/27/2002 06:25:53
Go to Top of Page

victord
Yak Posting Veteran

64 Posts

Posted - 2002-05-27 : 06:33:48
Thanks Hanif,
Vic.

Go to Top of Page
   

- Advertisement -