SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

ASCII Character Groups in String

By William Talada,

This function lets you accomplish some very difficult tasks with ease. If your server is case sensitive, you can still find all names entered in uppercase only. You can find comments containing extended ASCII characters. You can find which comments have formatting tabs and line feeds.

You can search on eight different classes of ASCII characters. You can search for their existence or absence in a string. Or you can pass null for the "don't care" classes.

The code is simple so you may redefine your own special categories such as "valid XML extended chars". The performance is acceptable for development and debugging conversions and upgrades.

This is really a swiss army knife in performing tasks that are nearly impossible otherwise.

Just create the function. The script at the end of the function's code will display how every ASCII character is categorized.

Total article views: 1003 | Views in the last 30 days: 1
Related Articles

ASCII ProperCase Function

Another ProperCase function that utilises the ASCII function


Function to find non-printable characters

The function is used to find non-printable ASCII characters in an input string.


Identifying ASCII characters in NVARCHAR columns

Identifying ASCII characters in NVARCHAR columns


Encoded text field in Foxpro truncated with no error

ASCII special character


character limitations on sp name, & function name

character limitations on sp name, & function name

control characters