title: How To Exclude System Table When Querying Sys.Tables?
body: <p>I'm running this SQL :</p>
  
  <pre><code>SELECT S.name as Owner, T.name as TableName FROM  sys.tables AS T
  JOIN sys.schemas AS S ON S.schema_id = T.schema_id
  </code></pre>
  
  <p>And the result is:</p>
  
  <pre><code>Owner   TableName
  ------------------------
  dbo         Person
  dbo         Customer
  dbo         sysdiagrams
  </code></pre>
  
  <p><code>sysdiagrams</code> is a <code>system table</code> but showed in result.</p>
  
  <p><strong>Update:</strong>
  Thanks all for your answers and comments, I'm using <strong>Nate Bolam</strong> &amp; <strong>vmvadivel</strong> answers:</p>
  
  <pre><code>SELECT S.name as Owner, T.name as TableName 
  FROM  
    sys.tables AS T
      INNER JOIN sys.schemas AS S ON S.schema_id = T.schema_id
      LEFT JOIN sys.extended_properties AS EP ON EP.major_id = T.[object_id]
  WHERE 
    T.is_ms_shipped = 0 AND 
    (EP.class_desc IS NULL OR (EP.class_desc &lt;&gt;'OBJECT_OR_COLUMN' AND 
    EP.[name] &lt;&gt; 'microsoft_database_tools_support'))
  </code></pre>