Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Problem with PATINDEX function for case-sensitive information

$
0
0

Hi,

 

My database is not case-sensitive, but I want output like...

 

SELECT patindex('%[A-Z]%','gaurang Ahmedabad')

 

The output should be first occurrence of uppercase A to Z, so output should be 9 it should not be 1.

 

Above query is giving output as 1 bcoz the 1st character in the expression is 'g' and it is in A to Z, but this is not capital 'G'. The 1st capital letter in the expression is 'A' (9th character in the expression).

 

Is there anyway to achieve this using PATINDEX? or Is there any other way to achieve this?

 

Thanks,

 

Gaurang Majithiya


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>