I have 3 table of data: some people has access a branch(s) and branch can have some sub branches

 Table Persons
--------------

```
ID     PName
1       P1
2       P2

```

 Table Branches
---------------

```
ID    Title    BrachIDRef
0      Master    null
1        B1       0 
2        B2       1
3        B3       2
4        B4       2
5        B5       1
6        B6       0
7        B7       6

```

 Table PersonBranches
---------------------

```
Id  PersonIDref     BranchIDref
1   1                   1
2   2                   6
3   2                   2

```

And Result I need is Access of Persons to branches and Sub branches in SQL Server Query like this :

```
P1  B1 
P1  (and All Childs of B1 - for each child have a record of data)
P2  B6
P2  and All Childs if B6
P2  B2
P2  and All Childs Of B2

```