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 |
|
albertkohl
Aged Yak Warrior
740 Posts |
Posted - 2007-11-20 : 18:49:00
|
| how would i run something like this:select * from zipinfo2 where county like "%'%"i know i cant use the double quotes, and they would usually be single quotes, but i cant because i'm looking for a single quote.any help would be great! i'm sure it's something dumb :o) |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-11-20 : 18:54:47
|
| LIKE '%[']%'Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
albertkohl
Aged Yak Warrior
740 Posts |
Posted - 2007-11-20 : 20:12:52
|
| select * from zipinfo2 where county LIKE '%[']%'Msg 102, Level 15, State 1, Line 1Incorrect syntax near ']'.Msg 105, Level 15, State 1, Line 1Unclosed quotation mark after the character string ''. |
 |
|
|
Haywood
Posting Yak Master
221 Posts |
Posted - 2007-11-20 : 20:45:22
|
| [code]CREATE TABLE Foo (State varchar(10))INSERT INTO Foo VALUES ('Foo''Bar')SELECT * FROM FooSELECT * FROM Foo WHERE State LIKE '%''%'[/code] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-21 : 01:01:31
|
| or1 like '%'+char(39)+'%'2 charindex('''',col)>0MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|