• Resolved.

    parent table column referring itself. that is why my sp is getting error nesting level exceeded (limit 32).

    I have modified SP and it worked

    WHERE SO2.Name = @cTableName and so1.name <> so2.name

    Thanks Lutz.