Searching for a string in multiple fields in a table There's lots of examples of complex systems to find a string in all the columns in a table or DB. Mine has to look for a string in 10 fields out of about 100 in a particular table, so these solutions are too complex.

Right now I do the dumb thing:

SELECT * FROM sometbl WHERE FIELD0 LIKE 'zap' OR FIELD1 LIKE 'zap'...


But this results in really nasty-to-read SQL. So then I thought...

SELECT * FROM sometbl WHERE '%zap%' LIKE FIELD0+FIELD1+FEILD2...


I cannot convince myself this works. For one, is the LIKE bi-directional so that can I put the %'s on the LHS? Or do those %'s have to be on the RHS?

So then I thought...

SELECT * FROM sometbl WHERE CHARINDEX('zap',FIELD0+FIELD1+FEILD2...) &gt; 0


Can anyone comment on these solutions, and whether I should use any of them?
If you are not using any wild cards then can use =  

Starting a like with % kills the use of an index
Not good 

Just stay with 

SELECT * 
  FROM sometbl 
 WHERE FIELD0 = 'zap' 
    OR FIELD1 = 'zap'


Can use variable to only set once
Can use in

declare @val varchar(200)  = 'message/rfc822'

select sID, mimeType, caseID 
  from docSVsys 
 where mimetype = @val 
    or caseID   = @val;

select sID, mimeType, caseID 
  from docSVsys 
 where @val in (mimetype, caseID)