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)
 Triggerproblem

Author  Topic 

cecilius
Starting Member

19 Posts

Posted - 2000-10-04 : 16:37:07
Ok, here it is:

I will write a trigger, which selects a single dataset, reads one value and writes this (on insert) in another dataset in another field. Let me say in my table "users" with field "username", "partner" and "friend" the trigger has to read the field "partner" from the inserted dataset. Then he has to move through the table, select the dataset, where THIS "partner" is = "username". From this found dataset he has to read the new "partner" and then jump back to the original and inserted dataset, and has to write THIS NEW PARTNER-Value in the field "friend"

like this:

Username | Partner | Friend
----------+------------+------------
A | null | null
B | A | null
c | B | >> A << <-- This "A" should come from


the partner-Row in the second line.


Has anybody ideas?

Greetings and thank you for all!
















   

- Advertisement -