DP-800

Implement external tables

This article explains external tables, where the schema is in SQL Server but the data is held elsewhere. It covers data virtualization with PolyBase in Azure SQL Database and SQL database in Fabric, and elastic queries in Azure SQL Database, using vertical or horizontal partitioning, together with the objects that each one needs.

Phillip Burton  · Published 5 December 2026

What an external table is

You can create tables where the schema (column names, data types and so on) is in SQL Server, but the data is outside of SQL Server. External tables can be used for:

  • data virtualization using PolyBase, in Azure SQL Database and SQL database in Fabric; and
  • elastic queries, in Azure SQL Database.

Data virtualization with PolyBase

For Azure SQL Database and SQL database in Fabric, external tables can be used for data virtualization using PolyBase.

Data sources

  • You can use T-SQL to query data in SQL Server, Oracle, Teradata, MongoDB, Hadoop clusters, Cosmos DB and S3-compatible object storage.
  • For additional sources, you can also use third-party ODBC drivers.

It allows querying from:

  • relational tables;
  • semi-structured data; and
  • structured file-based data formats. For example, CSV, Parquet files, files in JSON format and Delta Lake files.

Benefits

Data virtualization allows for:

  • using external data as if it was in SQL Server;
  • moving older, less-used data onto other platforms;
  • reducing the complexity of integrating external data sources;
  • real-time insights; and
  • using SQL Server security features.

What you need

To use data virtualization, you need:

  1. a database master key;
  2. a database scoped credential, using either a Shared Access Signature (SAS) and secret, or a managed identity, to allow authentication and authorization to the data source;
  3. an external data source, which uses the database scoped credential;
  4. an external file format, to specify what format the data is in; and
  5. the external table itself.
CREATE EXTERNAL TABLE NameOfTable (structure)
WITH (DATA_SOURCE = ExternalDataSource,
      LOCATION = 'Location',
      FILE_FORMAT = ExternalFileFormat);

Elastic queries

For Azure SQL Database, external tables can also be used for elastic queries.

  • You can then query multiple databases, including from remote Microsoft and non-Microsoft tools, to get a single result. For example, Excel, Power BI and Tableau.
  • Elastic queries cannot be used against data sources which are not databases.

Vertical and horizontal partitioning

You can employ:

  • vertical partitioning (cross-database querying), where different tables are on different databases; or
  • horizontal partitioning (sharding), where tables with the same schema on different databases have different parts of the data.

What you need

Again, you would need to create:

  1. a master key;
  2. a database scoped credential;
  3. for horizontal partitioning, a shard map, which maintains the mapping of the databases (shards);
  4. an external data source; and
  5. an external table.

The external data source would be of type:

  • RDBMS for vertical partitioning; or
  • SHARD_MAP_MANAGER for horizontal partitioning.

Important

As of April 2027, SHARD_MAP_MANAGER will be discontinued, and you would need to use more specific options for the relevant data source.

You can then access the external table as if it were a single table.

Exam tip

Keep the two partitioning types distinct. Vertical partitioning puts different tables on different databases and uses an RDBMS external data source. Horizontal partitioning (sharding) puts different parts of the data, with the same schema, on different databases, and needs a shard map.

Continue studying DP-800

This article covers Implement external tables, part of the Design and implement database objects section of the DP-800 study guide.

← Back to the DP-800 study guide

Leave a Comment