Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft SQL Server Like keyword

Any inputs on making Like keyword in Microsoft SQL server act as Case-sensitive.

For example : Name Like 'David' gets all the names David or david or daVid etc. My goal is to get only David.I am interested in knowing different ways from the experts.

like image 890
karthik gorijavolu Avatar asked Feb 20 '23 20:02

karthik gorijavolu


1 Answers

You need to use collation.

SELECT * FROM myTable  
WHERE LastName COLLATE Latin1_General_CS_AS = 'smyTH' 
like image 55
Darren Avatar answered Mar 02 '23 20:03

Darren