Link to home
Start Free TrialLog in
Avatar of jdr0606
jdr0606Flag for United States of America

asked on

Find special characters using tSQL

I have a table with parts and part descriptions.

I need to find any part that has a special character in in.  Special characters that I'm most concerned with are % , : ; " ' ? / \

What is the best way to find those parts?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
HI jdr0606,

SELECT ColumnName FROM TableName WHERE ColumnName  like '%[^a-Z0-9]%'

Character which are in the set a-Z and 0-9
Avatar of jdr0606

ASKER

Perfect!

Thanks
Avatar of jdr0606

ASKER

One more question, how would I look for a single quote i.e. '
CHARINDEX( ''', [Description]) 'Has ''
Avatar of jdr0606

ASKER

Unfortunately that doesn't work

Msg 102, Level 15, State 1, Line 28
Incorrect syntax near 'Has'.