Skip to content
Advertisement

How to trim all lowercase characters that comes before an uppercase character in a string using sql server

How can I write an SQL Server query to trim all lowercase characters that comes before the first uppercase character in a string? e.g. string value “eaplgCostPrice”, remove “eaplg” and pass “CostPrice” to a new column

Advertisement

Answer

If PATINDEX is used in combination with certain collations then it can function case dependent.

Example snippet:

Result:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement