9

I want to find out all rows that have a double quotes character in a particular field.

I am trying something like charindex(columnname,'""') in the where clause, but it does not seem to work.

Any help will be much appreciated.

3
  • 2
    tried select * from %tablename% where %columnname% like '%"%'? Jul 1, 2016 at 10:20
  • why don't you try like operator?
    – Sankar
    Jul 1, 2016 at 10:20
  • user5226582 answer is totally valid. If you want to use programming instead database, you can do: charindex ($col, '""'); or you can try " (HTML number of ") instead " (HTML name of ")
    – JoelBonetR
    Jul 1, 2016 at 10:24

2 Answers 2

9

If there is only one double quote then you should try

select * from tablename where columnname like '%"%'

If you know that there are two consecutive double quotes then, I would suggest you to use a like statement

select * from tablename where columnname like '%""%'

Otherwise if you don't know then you should try(Which is more preferable)

select * from tablename where columnname like '%"%"%'
0
3

Try this.

SELECT * FROM tb WHERE col Like '%"%'

Or

SELECT * FROM tb WHERE CHARINDEX('"',col) > 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.