Regular Expressions – lowercase characters | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Regular Expressions – lowercase characters

Hi all! I would like to filter on a varchar(20) field in a table to get only records which include at least one lowercase character; records where this field contains only uppercase characters or numbers should be excluded from the result. I fiddled a lot with regular expressions, but I don’t succeed. [V] Could anyone give me a clue? Thanks in advance! Kind regards,
Jörg Jörg A. Stryk
Freelance NAV System Consultant (MCP, MBSCP)
STRYK System Improvement
www.stryk.info
Instead of trying perform case sensitive comparisons on the backend, try taking advantage of your client side applications using ASP.NET or VB.NET. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
Hi! Thanks for your reply! Well, I need this just for troubleshooting: The application is MS Dynamics NAV, which has its own development environment called C/SIDE. Here there exists a datataype "Code" which is translated to "varchar" in SQL Server. C/SIDE only allows UPPERCASE characters in Code-fields!
We have the issue, that obviously external applications/interfaces have written lowercase characters into those Code-fields, which causes the NAV application to crash. So, what I would like to do is to find out which records are effected so I could modify them to UPPERCASE … Jörg A. Stryk
Freelance NAV System Consultant (MCP, MBSCP)
STRYK System Improvement
www.stryk.info
See thishttp://www.databasejournal.com/features/mssql/article.php/3655906 is any help. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
Yep, that helped – this is what I got now: update dbo."CRONUS International Ltd_$Item"
set [No_] = upper([No_])
where (patindex(‘%[a-z]%’, [No_]) > 0) ([No_] is the problematic Code/varchar field) It seems that within the filtered range there are more records than I intended, but far less than the whole table.
As far as I could test it works. Any suggestions for improvement? Jörg A. Stryk
Freelance NAV System Consultant (MCP, MBSCP)
STRYK System Improvement
www.stryk.info
]]>