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.
I've successfully modified these to use external tables that use an external data source which is created using the following:
CREATE EXTERNAL DATA SOURCE [MyExternalDataSource] WITH
(
TYPE = RDBMS,
LOCATION = 'SqlServerName',
DATABASE_NAME = 'SqlServerDatabaseName',
CREDENTIAL = cred
);
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:
Incorrect syntax near 'RDBMS'
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.
As a workaround, I'm considering the following options, though each have their drawbacks:
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.
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)
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?