Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ZLA
Starting Member
6 Posts |
Posted - 2005-11-01 : 14:56:58
|
| I have a varchar column which may contain a double quote symbol. For example, my data may look like the following:Jim said, "Hi there."If I try to search for this record via TSQL, I always come up empty. I've tried to use the following:SELECT * FROM MyTable WHERE MyColumn LIKE '%"%'That doesn't work.Can anyone tell me the correct syntax or method to find these records?Thanks in advance. |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2005-11-01 : 15:57:02
|
Declare @str varchar(100)Set @str = 'Jim said, "Hi there."'Select case when @str like '%"%' then 1 else 0 endCorey Co-worker on children "...when I have children, I'm going to beat them. Not because their bad, but becuase I think it would be fun ..." |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-11-01 : 16:01:04
|
Your syntax works for me. does this not work on your machine?SELECT * FROM (select 'Jim said, "Hi there"' as myColumn) as MyTable WHERE MyColumn LIKE '%"%' Be One with the OptimizerTG |
 |
|
|
ZLA
Starting Member
6 Posts |
Posted - 2005-11-01 : 16:40:39
|
| I went back and checked and now its working. The data I thought I was looking for must not have been there when I searched for it. Thank you both. |
 |
|
|
|
|
|