Reference

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 Required Options
Name: Table

Label: Table Name (Case-Sensitive)

YES
Name: Database

Label: Database Name (keep blank to use default) Case-Sensitive

Leave blank to use default DB set on connection screen

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length 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 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 or in API Destination SSIS Data Flow components to read or write data.

API Source

API Source - Cosmos DB
Connect to your Azure Cosmos DB databases to read, query, create, update, and delete documents and more!
Cosmos DB
Get table partition key ranges
Required Parameters
Table Name (Case-Sensitive) Fill-in the parameter...
Optional Parameters
Database Name (keep blank to use default) Case-Sensitive
SSIS API Source - Read from table or endpoint

API Destination

API Destination - Cosmos DB
Connect to your Azure Cosmos DB databases to read, query, create, update, and delete documents and more!
Cosmos DB
Get table partition key ranges
Required Parameters
Table Name (Case-Sensitive) Fill-in the parameter...
Optional Parameters
Database Name (keep blank to use default) Case-Sensitive
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];