title: Search implementation across multiple columns
body: <p>Let's say I have a table like:</p>
  
  <pre><code>Persons  
    FirstName varchar(50)  
    LastName varchar(50)
    EmailAddress varchar(200)  
  </code></pre>
  
  <p>Now, let's say I have a google like search box; in other words just one textbox with a search button.</p>
  
  <p>Normally we do something like:</p>
  
  <pre><code>declare @searchTerm varchar(50)
  set @searchTerm = 'tom'
  
  select *
    from Persons
    where (FirstName = @searchTerm) 
       or (LastName = @searchTerm)
       or (EmailAddress = @searchTerm)
  </code></pre>
  
  <p>What I'd like to do is be able to pass both the first and last name (for example) into the @searchTerm variable, but my brain just doesn't want to build that query. ;)</p>
  
  <p>For example:</p>
  
  <pre><code>declare @searchTerm varchar(50)
  set @searchTerm = 'tom smith'
  
  select *
    from Persons
    where ????
  </code></pre>
  
  <p>The idea is to return all records where 'tom' OR 'smith' appear in those fields.  </p>