La solution que j'ai trouvée n'est pas bonne du tout. Il donne la bonne réponse mais est très lent, même pour ce tout petit tableau.
DECLARE @INCLUIDOS TABLE (ID INT)
INSERT INTO @INCLUIDOS VALUES(1)
DECLARE @PAST_QUANT INT = 0
DECLARE @QUANT INT = 1
WHILE @QUANT <> @PAST_QUANT
BEGIN
SET @PAST_QUANT = @QUANT
INSERT INTO @INCLUIDOS
SELECT PARENT
FROM PERSONCONN
WHERE CHILD IN (SELECT ID FROM @INCLUIDOS)
AND PARENT NOT IN (SELECT ID FROM @INCLUIDOS)
INSERT INTO @INCLUIDOS
SELECT CHILD
FROM PERSONCONN
WHERE PARENT IN (SELECT ID FROM @INCLUIDOS)
AND CHILD NOT IN (SELECT ID FROM @INCLUIDOS)
SET @QUANT = (SELECT COUNT(*) FROM @INCLUIDOS)
END
SELECT DISTINCT ID FROM @INCLUIDOS