title: unresolved reference to object [INFORMATION_SCHEMA].[TABLES]
body: <p>I've created a UDF that accesses the <code>[INFORMATION_SCHEMA].[TABLES]</code> view:</p>
  
  <pre><code>CREATE FUNCTION [dbo].[CountTables]
  (
      @name sysname
  )
  RETURNS INT
  AS
  BEGIN
      RETURN
      (
          SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = @name
      );
  END
  </code></pre>
  
  <p>Within Visual Studio, the schema and name for the view are both marked with a warning:</p>
  
  <blockquote>
    <p>SQL71502: Function: [dbo].[CountTables] has an unresolved reference to object [INFORMATION_SCHEMA].[TABLES].</p>
  </blockquote>
  
  <p>I can still publish the database project without any problems, and the UDF does seem to run correctly. IntelliSense populates the name of the view for me, so it doesn't seem to have a problem with it.</p>
  
  <p>I also tried changing the implementation to use <code>sys.objects</code> instead of this view, but I was given the same warning for this view as well.</p>
  
  <p>How can I resolve this warning?</p>