HI ,,
i have two different Tables, One is used to store data, and second is used to show the relationship that the data is stored in the first table...
TABLE1
DocID Email Qty_Atch Attch_Doc
1 A 0 0
2 B 1 B1
Now Attachement should have DocID So
3 B1 0 0
4 C 3 C1,C2,C3
Now Attachement should have DocID So
5 C1 1 C12
Now Attachement should have DocID So
6 C12 0 0
7 C2 0 0
8 C3 0 0
in second table i have saved the relationship which is parent and which is child .. like this
ParentDocID ChildDocID
2 3
4 5
5 6
4 7
4 8
what i need is to save the DocID into another table in such a formate that if the documents are interrelated to each other should get single ID.. like this by a Store procedures..
Newly_DocID DocID
1 1
2 2
2 3
3 4
3 5
3 6
3 7
3 8