title: Error 'Invalid object name INFORMATION_SCHEMA.TABLES'
body: <p>I'm getting an error when running the following code thru an <code>ASP/ C# .NET</code> page:</p>
  
  <pre><code> SELECT 1 FROM [database].INFORMATION_SCHEMA.TABLES 
   WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='example_table'
  </code></pre>
  
  <p>The code runs perfectly when I run it in the <code>sql management studio query</code> window.
  It's also only broken for 1 specific <code>server</code> - when I run on a different <code>server</code> with a different <code>connection string</code>, it works fine.</p>
  
  <p>I've scoured the internet, and all I can seem to find as an answer is that there are issues with case sensitivity, but I'm using all uppercase, and the table in question is using <code>SQL_Latin1_General_CP1_CI_AS collation</code> anyway.</p>
  
  <p>Based on all this, I'm pretty sure it's some kind of permissions issue, but I'm not really sure where to look.</p>
  
  <p>The error I'm getting:</p>
  
  <blockquote>
    <p>Invalid object name 'database.INFORMATION_SCHEMA.TABLES'.</p>
  </blockquote>
  
  <p>The connection string:</p>
  
  <pre><code>&lt;add name="connectionName" connectionString="Data Source=servername; Initial Catalog=master; User ID=user; Password=pw" providerName="System.Data.SqlClient"/&gt;
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>Some more information:  I had adapted this code from some older VB stuff that basically does the same thing.  The VB code runs the same exact query on the same servers and databases, but it works.</p>
  
  <p>The VB code:</p>
  
  <pre><code>Dim connStr As String = ConfigurationManager.ConnectionStrings("connectionName").ConnectionString
  Dim objConnection As SqlConnection = New SqlConnection(connStr)
  Dim objCommand As SqlCommand = New SqlCommand("SELECT 1 FROM [database].INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='example_table'", objConnection)
  objCommand.CommandType = CommandType.Text
  
  objConnection.Open()
  </code></pre>
  
  <p>The C# and VB code both use the exact same connection string from web.config, so I suppose that leads me to doubt that it would be a permissions issue.  Still no clue what the problem is though.</p>