Search code examples
sqlazureperformance

Cross database SQL query performance in Azure


I have a SQL query to join 2 tables in different databases (both are on-premises servers). The query is very slow. And I need to set them as Connected Database.

If 2 databases are both on Azure cloud, will the SQL query be quicker?


Solution

  • You can create the external table in the SQL server database and use it like a local table in the database. The external table will give you the super performance and reduce the latencies of connecting to other database to fetch the table data.

    https://learn.microsoft.com/en-us/sql/t-sql/statements/create-external-table-transact-sql?view=sql-server-2017&tabs=dedicated