• Aha! I found where you hid it eventually 😀

    There's no need for a loop! What's wrong with PATINDEX for this sort of thing?

    SELECT PATINDEX('%[^A-Za-z0-9 ]%', 'ABC 123')

    SELECT PATINDEX('%[^A-Za-z0-9 ]%', 'ABC*123')