title: SQL71501 SSDT unresolved references - compare schema
body: <p>Ok, there are a bunch of posts about this, but all different versions of the problem.  I could not find a post with my specific (albeit, basic) version of the problem.  First, these are the steps that I followed to create a database project in Visual Studio 2012 (shell) with SQL Server Data Tools (SSDT):</p>
  
  <ul>
  <li>Create new project, SQL-> database project</li>
  <li>Right click on project, choose "Compare Schema" </li>
  <li>Set source (SQL Server instance on a server)</li>
  <li>Set target (local database project - the current project)</li>
  <li>Run the "Schema Compare"</li>
  <li>Update the target</li>
  </ul>
  
  <p>This gives me a populated database project of all the objects in SQL server database.  However, upon building the project, I get 200+ errors of unresolved references:</p>
  
  <blockquote>
    <p>X- contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: X, Y, Z</p>
  </blockquote>
  
  <p>AND</p>
  
  <blockquote>
    <p>X- has an unresolved reference to object</p>
  </blockquote>
  
  <p>Adding a database reference to Master cut the errors down to 127, and now it's more manageable, but this not resolved.  It only affects 5 or 10 objects out of 100's. Here's some things to keep in mind:</p>
  
  <ol>
  <li><p>Only one database is used in the SQL Server objects (views, etc.)</p></li>
  <li><p>Only 2 part naming ie (dbo.Table as T)</p></li>
  <li><p>The "Enable Extended Transact-SQL verification for common objects" option is not present in my version of VS 2012, this feature was removed by Microsoft, and is already turned off.</p></li>
  <li><p>I ran the command line <code>sqlpackage.exe</code> and created a dacpac of the database, this was then added as a database reference.</p></li>
  </ol>
  
  <p>The database project will still not build. The errors only pertain to certain views and procedures. Has anyone had this problem?  </p>