You can use the COLLATE LATIN1_GENERAL_CS_AI
in its validation as follows:
DECLARE @texto_normal VARCHAR(100);
DECLARE @texto_minusculo VARCHAR(100);
SET @texto_normal = 'Normal';
SET @texto_minusculo = 'minusculo';
IF LOWER(@texto_normal) <> @texto_normal COLLATE LATIN1_GENERAL_CS_AI
BEGIN
PRINT '@texto_normal tem maiúsculas';
END;
IF LOWER(@texto_minusculo) <> @texto_minusculo COLLATE LATIN1_GENERAL_CS_AI
BEGIN
PRINT '@texto_minusculo tem maiúsculas';
END;
Or to use in a query
:
SELECT *
FROM tabela t
WHERE LOWER(t.campo) <> t.campo COLLATE LATIN1_GENERAL_CS_AI;
The CS_
selector says the text is case sensitive
.
Reference: Collation and Unicode Support
You want to test whether it has uppercase letters or all uppercase letters?
– Jeferson Almeida
Imagine you have that value in your field:
TEXTO Correto
, would be either right or wrong?– Marconi
The need is to find out if the field has the whole text in Maíusculo.
– Rafael Dantas