To by mělo fungovat:
DECLARE @Group VARCHAR(50)
SET @Group = 'Karnataka Customers'
;WITH CTE AS
(
SELECT *
FROM [dbo].[LedgerGroups]
WHERE GroupParent = @Group
UNION ALL
SELECT B.*
FROM CTE A
INNER JOIN [dbo].[LedgerGroups] B
ON A.GroupName = B.GroupPArent
)
SELECT *
FROM CTE
OPTION(MAXRECURSION 0);
A zde je funkční sqlfiddle abyste to zkusili.