title: How can I identify only base tables when iterating through all tables in SQL smo?
body: <p>This is my code:</p>
  
  <pre><code>Server server = new Server(new ServerConnection(con));
  server.ConnectionContext.Connect();
  
  foreach (Table table in server.Databases[sqlDatabase].Tables)
  {
      if (table &lt;is a base table&gt;)
  </code></pre>
  
  <p>Basically this pulls back views as well I think. The SQL I use to identify the wanted tables is:</p>
  
  <p><code>SELECT TABLE_NAME FROM MyDatabase.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'</code></p>
  
  <p>However there doesn't seem to be a <code>TABLE_TYPE</code> property on the results which are <code>Microsoft.SqlServer.Management.Smo.TableCollection</code>. According to SQL, the TABLE_TYPE is either <code>BASE TABLE</code> or <code>VIEW</code> so only two possibilities.</p>
  
  <p>How can I identify only tables (and not views)?</p>