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)
 trigger help

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-06-21 : 11:02:19
robby writes "I'm new to triggers and have created the following:

create trigger test_1 on table A for insert, update as

Insert into table B (field D, field G)
select field y, field j from table a
where not exists
(select * from table b where table b.field x = table a.field y)
go

I would like the trigger to copy the record to the other table, at the present time it is deleting it fom table A and inerting it into table B. there are no relationships between the two tables.

Thank You"
   

- Advertisement -