sqlsql-serverazureazure-sql-databasecross-database

How to call a local SQL Server stored procedure from an Azure SQL database?


I have a stored procedure in a SQL Server 2014 database on site. I need to call this stored procedure from an Azure SQL database.

How can I implement this?

I have read about elastic queries but I find that elastic queries works for Azure databases only.


Solution

  • You cannot, unless you move your local database to Azure.

    If this was not Azure, you could use linked servers feature, but this is not supported by Azure.

    Alternatively you could try to reverse situation and call Azure procedures from your local database, which is supported.

    https://msdn.microsoft.com/en-us/library/ms190479.aspx