Home > Archive > MS SQL Server > October 2006 > Trigger among 3 tables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Trigger among 3 tables
Jason Huang

2006-10-24, 6:28 pm

Hi,

This is kind of strange to me.In my SQL Server 2000, I have 3 tables.

TableA(AIndex, A2, A3, AStatus)

TableB(BIndex,B2, AIndex, BStatus)

TableC(CIndex,C2,AIn
dex,BIndex,CStatus)

I create a trigger tr_AtoB so that whenever I change the AIndex or AStatus,
the TableB will also updated.
I create a trigger tr_BtoC to do the same thing, only the AIndex part works,
the CStatus won't.

We can't change the schema of TableA, TableB, TableC, cuz they are alreay in
using.
Thanks for help.


Jason



Razvan Socol

2006-10-24, 6:28 pm

Post the table DDL (including primary keys, foreign keys and other
constraints), the code of the triggers, some sample data and expected
results in several scenarios and more clear specifications and we may
be able to help.

Razvan

PS. In the mean time, you can also take a look at nested triggers and
recursive triggers in Books Online.

Jason Huang wrote:
> Hi,
>
> This is kind of strange to me.In my SQL Server 2000, I have 3 tables.
>
> TableA(AIndex, A2, A3, AStatus)
>
> TableB(BIndex,B2, AIndex, BStatus)
>
> TableC(CIndex,C2,AIn
dex,BIndex,CStatus)
>
> I create a trigger tr_AtoB so that whenever I change the AIndex or AStatus,
> the TableB will also updated.
> I create a trigger tr_BtoC to do the same thing, only the AIndex part works,
> the CStatus won't.
>
> We can't change the schema of TableA, TableB, TableC, cuz they are alreay in
> using.
> Thanks for help.
>
>
> Jason


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com