title: Compare variable against multiple columns of different data types?
body: <p>I am trying to lookup a search term passed into <code>@Search</code> in both an <code>INT</code> column and  a <code>NVARCHAR</code> column.</p>
  <p>I have done searching multiple columns in the past similar to below but have never had to compare against different column types.</p>
  <pre><code>@Search NVARCHAR(1000)
  
  SELECT
    [Stuff]
  FROM 
    [Tables]
  WHERE
    [IDColumn] = ISNULL(@Search, [IDColumn])
  OR
    [TextColumn] LIKE '%' + TRIM(@Search) + '%'
  </code></pre>
  <p>How can the passed in variable be checked against multiple columns of different data types?</p>