not working correctly
let say TableA have this row
id name followid
--- --------- -----------
a a e
b b e
c c e
d d e
e e null
when changing e to f
id name followid
--- --------- -----------
a a f
b b f
c c f
d d f
f e null
>>Can someone help me with this :-
>>
>>Table A
>>-----------
>>id
>>name
>>followid (follow another record id)
>>
>>
>>i need to create a trigger on Table A so whenever the id change,
>>a trigger will fire on Table A to update all the followid that have the same value as the inserted.id
>>
>>
>>thanks in advance
>
>You need to be careful to not fall into infinite loop
>
>create trigger tr_TableA_Update ON TableA for UPDATE
>AS
> BEGIN
> update TableA set FollowID = Inserted.ID from TableA
>inner join Inserted on ID = Inserted.ID inner join Deleted on TableA.FollowID = Deleted.ID
> END