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
 Transact-SQL (2000)
 Update trigger

Author  Topic 

mebrian
Starting Member

1 Post

Posted - 2005-03-15 : 12:56:09
I have been manually updating some new tables with new data, but I want to pull old data as well from old tables. So, I want to create an UPDATE Trigger to copy values from 2 different tables to the third to take care of new entries.

Here a simplified version of what I want to do.

Equip
equip.classid = xx
equip.Failure = <-- r
equip.Code = <-- q
Struct
struct.classid = xx
struct.column1 = q
struct.column2 = yy
Asset
asset.assetid = yy
asset.column1 = r

In words:

Update
set equip.Code = struct.column1
set equip.Failure = asset.column1
where equip.classid = struct.classid
AND asset.assetid = struct.column2

I have never done much with sp or triggers, but
once I see how it works I think I can work out what I want to do.
I really appreciate the help.
Thanks.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-15 : 14:23:47
ok so on which table do you want the trigger to be on.
and to which tables would you like to insert what data??

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -