title: Running SQL Server database locally when using Azure-specific functionality?
body: <p>I'm looking into migrating a project using on-premises SQL Server to SQL Azure. The database has cross-database dependencies, where some views reference another database on the same server, which is not supported by SQL Azure.</p>
  
  <p>I've successfully modified these to use external tables that use an external data source which is created using the following:</p>
  
  <pre><code>CREATE EXTERNAL DATA SOURCE [MyExternalDataSource] WITH
  (
      TYPE = RDBMS,
      LOCATION = 'SqlServerName',
      DATABASE_NAME = 'SqlServerDatabaseName',
      CREDENTIAL = cred
  );
  </code></pre>
  
  <p>However, the RDBMS type used by this type of data source appears to be supported by SQL Azure only and not on-premises SQL Server. Running this script against the former works correctly, while the latter causes the following error to be thrown: </p>
  
  <blockquote>
    <p>Incorrect syntax near 'RDBMS'</p>
  </blockquote>
  
  <p>As a result, it means that the database project in the solution cannot be used to target both Azure SQL and a local SQL Server installation.</p>
  
  <p>As a workaround, I'm considering the following options, though each have their drawbacks:</p>
  
  <ol>
  <li><p>Have multiple database projects in the solution, with one targeting SQL Azure and other targeting SQL Server - though this will mean duplicating any database updates to both projects.</p></li>
  <li><p>Move away from using external tables to the data sync functionality offered by Azure instead, and duplicate the tables and data in both databases (removing the need to use the external data source causing the problem) - though this has a minimum 5 minute delay (may be acceptable in this specific case, but certainly not for everyone)</p></li>
  </ol>
  
  <p>How are other developers handling this sort of scenario where SQL Azure specific features like this need to be used on your project but you also need to be able to run a local copy of the database for development as well?</p>