on 2013 Mar 25 5:00 PM
I found this select syntax online but not able to make it work. Please help.
I have a table that have colName as TEXT column that has special ascii characters from 0 thru 31. I an trying to do a select for this colName that will replace all special characters as '?' What am I doing wrong in this select?
select REPLACE(**colName**, SUBSTRING(**colName**, PATINDEX('%[^a-zA-Z0-9 ]%', **colName** collate Latin1_General_BIN), 1), '?') from table WHERE PATINDEX('%[^a-zA-Z0-9 ]%', **colName** collate Latin1_General_BIN) <> 0
Take a look at my answer to a similar question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.