SQL parse string to get dependent info I have a 2 tables

CREATE TABLE testmain
(dummy_Id numeric(10,0) null,
 memberNo varchar(100)  null)

CREATE TABLE testchild
(dummy_Id numeric(10,0) null,
 xummy_Id numeric(10,0) null)


where xummyId is the dependent meber dummyId

The testmain table has data as of these:

SELECT * FROM testmain

1001 82411/1
1002 82411/2
1003 85545/1
1004 82411/3
1005 85545/2


The left part of memberNo is the code and the last part is the dependent member.

So in the above example 82411/1 is the master and 82411/2,82411/3 are its child members

I need to parse the testmain table and for each entry of type 
code/1 and insert in the testchild the dummyIds of the child members

SELECT * FROM testchild

1001 1002
1001 1004 
1003 1005 


Thanx in advance
patindex can do want you expect:

select a.dummy_Id, b.dummy_Id
from testmain a
join testmain b on left(a.memberNo,patindex('%/%', a.memberNo)-1) = left(b.memberNo,patindex('%/%', b.memberNo)-1)
                    and b.memberNo not like '%/1'
                    and a.dummy_Id &lt;&gt; b.dummy_Id
and a.memberNo like '%/1'