Cosmos DB Connector
Documentation
Version: 2
Documentation
Endpoint

Get table partition key ranges


Name

get_partition_keyranges

Description

Gets Partition Key Ranges for a table. This is useful for query if you want to minimize scan to specific partition (Tables are also called 'containers' or 'collections')

Parameters

Parameter Label Required Options Description
Table Table Name (Case-Sensitive) YES
Database Database Name (keep blank to use default) Case-Sensitive NO Leave blank to use default DB set on connection screen

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Raw Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.
If the column you are looking for is missing, consider customizing Cosmos DB Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Raw Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.

Examples

SSIS

Use Cosmos DB Connector in API Source component to read data or in API Destination component to read/write data:

Get table partition key ranges using API Source

Cosmos DB
Get table partition key ranges
SSIS API Source - Read from table or endpoint

Get table partition key ranges using API Destination

Cosmos DB
Get table partition key ranges
SSIS API Destination - Access table or endpoint

ODBC application

Use these SQL queries in your ODBC application data source:

Get table partition key ranges

SELECT * FROM get_partition_keyranges
WHERE Table = 'abcd-1234-table'

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Get table partition key ranges

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM get_partition_keyranges
WHERE Table = ''abcd-1234-table''';

EXEC (@MyQuery) AT [LS_TO_COSMOS_DB_IN_GATEWAY];