How to make a query to a case sensitive database?

1

I want to obtain the name that is associated with the user data and password in a table to which I make the following query in SQL Server.

select Nombre from usuarios where NombreUsuario  = 'UsuarioPrueba' and Contraseña = 'contRaPrueba';

The problem is that it does not matter if I have it with uppercase or lowercase, it brings me the same data

    
asked by Richard Yordy 07.04.2018 в 01:47
source

1 answer

1

Try this:

SELECT Nombre FROM usuarios 
  WHERE NombreUsuario  = 'UsuarioPrueba' AND 
        Contraseña = 'contRaPrueba' COLLATE Latin1_General_CS_AS;
    
answered by 07.04.2018 / 01:50
source