Saturday, November 19, 2011

Case Sensative Database Query

Normally, the information kept in a cell of a database is not case sensative. For the query as below


Select * from tblShopInfo where shopName='bata'
Select * from tblShopInfo where shopName='batA'
Select * from tblShopInfo where shopName='Bata'



we will get same results for the all of the above queries. But if we are in need to get the information of case sensative partameter. Then we need to make the query as below:


Select * from tblShopInfo where shopName COLLATE Latin1_General_CS_AS ='baTa'



The above query will return only the specific info we need.

No comments: