RakhiKalra
Programmer
Hi ,
I have the following structure:
Item table
----------
ItemId
ItemName
Item Transaction Table
----------------------
TransactionId
GiverItemId
SenderItemId
the data is somewhat like this:
Item table
__________
1 abc
2 xyz
3 pnr
4 rew
5 dds
6 djs
7 dsf
Item Transaction table
---------------------
1 1 2
2 2 4
3 4 3
4 3 7
Now i have a reauirement to build a stored proc in which all the transactions starting from one transaction like, if i want to know the chain for item no 2 it shall give the following result:
2 4
4 3
3 7
if i want to know the chain for item no 3 then it shall give following
3 7
if i want to know the chain for item no 1 then it shall give following
1 2
2 4
4 3
3 7
Please help.. Its urgent.....
Thanks in advance
Rakhi
I have the following structure:
Item table
----------
ItemId
ItemName
Item Transaction Table
----------------------
TransactionId
GiverItemId
SenderItemId
the data is somewhat like this:
Item table
__________
1 abc
2 xyz
3 pnr
4 rew
5 dds
6 djs
7 dsf
Item Transaction table
---------------------
1 1 2
2 2 4
3 4 3
4 3 7
Now i have a reauirement to build a stored proc in which all the transactions starting from one transaction like, if i want to know the chain for item no 2 it shall give the following result:
2 4
4 3
3 7
if i want to know the chain for item no 3 then it shall give following
3 7
if i want to know the chain for item no 1 then it shall give following
1 2
2 4
4 3
3 7
Please help.. Its urgent.....
Thanks in advance
Rakhi