Am I able to run update/alter/delete queries on 'Cross-Database Queries in Azure SQL Database'?

asked 2020-08-26T08:56:38.357+00:00
Mohammed, Irfan Khan (KT) 21 Reputation points

Hello

Is it possible to run update/alter/delete queries on 'Cross-Database Queries in Azure SQL Database'?

Thanks in advance.

Azure SQL Database
No comments
{count} votes

Accepted answer
  1. answered 2020-08-26T10:50:03.39+00:00
    Anurag Sharma 17,251 Reputation points

    Hi @Mohammed, Irfan Khan (KT) , Cross-database queries are limited to read only operations i.e. you can do a select on tables but wont be able to perform any DML operations. Below is the excerpt from official document:

    "Elastic query currently only supports read-only access to external tables. You can, however, use full T-SQL functionality on the database where the external table is defined. This can be useful to, e.g., persist temporary results using, for example, SELECT <column_list> INTO <local_table>, or to define stored procedures on the elastic query database that refer to external tables."

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.


1 additional answer

Sort by: Most helpful
  1. answered 2020-08-26T11:45:58.483+00:00
    Vaibhav Chaudhari 37,751 Reputation points

    It is possible only to select the data from other databases

    https://www.mssqltips.com/sqlservertip/6445/azure-sql-cross-database-query/

    To have DML operations across databases, consider upvoting below feedback.

    https://feedback.azure.com/forums/217321-sql-database/suggestions/11345247-support-for-dml-operations-with-external-tables-in


    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

    No comments