| Author |
Topic  |
|
|
AskSQLTeam
Ask SQLTeam Question
USA
0 Posts |
|
|
kvahalia
Starting Member
1 Posts |
Posted - 05/13/2002 : 15:03:01
|
i am using the same logic and have multiple joins to the same table. My sql query is
SELECT NAME,BM.ADDR,BB.ADDR,BS.ADDR FROM S_ORG_EXT A JOIN S_ADDR_ORG BM ON A.PR_ADDR_ID = BM.ROW_ID JOIN S_ADDR_ORG BB ON A.PR_BL_ADDR_ID = BB.ROW_ID JOIN S_ADDR_ORG BS ON A.PR_SHIP_ADDR_ID = BS.ROW_ID
This select statement essentially is part of my update trigger. I eventually want to monitor the addr field for update on all the three addresses (main, bill to, ship to). I envisage the final result to be something like these
SELECT NAME,BM.ADDR,BB.ADDR,BS.ADDR FROM S_ORG_EXT A JOIN Inserted BM ON A.PR_ADDR_ID = BM.ROW_ID JOIN inserted BB ON A.PR_BL_ADDR_ID = BB.ROW_ID JOIN inserted BS ON A.PR_SHIP_ADDR_ID = BS.ROW_ID
this doesn't work. I can only monitor update to one kind of addr at a time\, for instance
SELECT NAME,BM.ADDR,BB.ADDR,BS.ADDR FROM S_ORG_EXT A JOIN inserted BM ON A.PR_ADDR_ID = BM.ROW_ID JOIN S_ADDR_ORG BB ON A.PR_BL_ADDR_ID = BB.ROW_ID JOIN S_ADDR_ORG BS ON A.PR_SHIP_ADDR_ID = BS.ROW_ID
works fine. But i need to be able to monitor updates on all kinds of addresses.
Any ideas
thanks Kuntal
|
 |
|
| |
Topic  |
|
|
|