title: SQL like - select strings that contain unspecified characters
body: <p>First of all, apologies if this is a duplicate question. I've done my best to search but was unsuccessful, and I couldn't even properly word my question in terms of keywords!</p>
  
  <p>One of my tables has a column <code>Name (nvarchar)</code>. I want to find out which rows contain special characters <strong>without</strong> explicitly listing those characters. "Special" characters in my case means anything not in:</p>
  
  <pre><code>a-z A-Z 0-9 _ @ . , ( ) % + -
  </code></pre>
  
  <p>So for example:</p>
  
  <pre><code>Row 1: 'asdf Asdf 0123'
  Row 2: 'asdf (Asdf) 012/3'
  Row 3: 'zxcv [234]'
  Row 4: 'asdf #0123'
  </code></pre>
  
  <p>I want to select rows 2, 3 and 4.</p>
  
  <p>The easiest way is to include the characters I don't want, for example square brackets and slash:</p>
  
  <pre><code>SELECT * FROM Table
  WHERE Name LIKE '%[\]\[/]%' ESCAPE '\'
  </code></pre>
  
  <p>This returns rows 2 and 3, or if I use NOT LIKE, rows 1 and 4. However, I also want to find other characters which I may not have thought of (such as the #). Listing the characters that ARE wanted -</p>
  
  <pre><code>SELECT * FROM Table
  WHERE Name NOT LIKE '%[a-zA-Z0-9_@. ,()%+-]%'
  </code></pre>
  
  <p>doesn't work either, as it returns 0 results since all rows contain at least 1 of those characters.</p>
  
  <p>Is there a way to restrict the latter LIKE statement not to match <strong>any</strong> string that contains my desired characters, but rather strings that contain <strong>only</strong> the desired characters and nothing else?</p>