That will only check if there is a single char that is uppercase.
If you want to check if the whole string is uppercase then compare it to itself in uppercase:
SELECT
CASE WHEN @PROVA = UPPER(@PROVA)
THEN 'ok'
ELSE 'NO'
END
UPDATE: OP needs to restrict special chars.
There are a couple of options depending on your needs:
1: Parser function
This is probably the simplest solution. Create a function that checks each char of the string. It's easy to implement and maintain, but it can be very slow if you perform the operation on a large enough table
2: Regular Expressions:
A little trickier to implement but very powerful in the right hands. Take a look at this article for more:
https://www.simple-talk.com/sql/t-sql-programming/tsql-regular-expression-workbench/[
^]
Hope that helps ^_^
Andy