Reference

Endpoint Get List of Databases


Name

get_databases

Description

Gets a list of the databases in the current database account. [API reference]

Related Tables

SysDatabases

Parameters

Parameter Required Options
Name: MaxItemCount

Label: Max Rows Per Page (Adjust for Speed)

An integer indicating the maximum number of items to be returned per page.

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_WSTR nvarchar(255) 255 The unique name that identifies the collection.
ResourceId DT_WSTR nvarchar(2000) 2000 System generated property. The resource ID is a unique identifier that is also hierarchical per the resource stack on the resource model. It is used internally for placement and navigation of the permission resource.
LastUpdated DT_I4 int System generated property. Specifies the last updated timestamp of the resource.
ETag DT_WSTR nvarchar(4000) 4000 System generated property representing the resource etag required for optimistic concurrency control.
Collections DT_WSTR nvarchar(4000) 4000
Users DT_WSTR nvarchar(4000) 4000
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

This Endpoint belongs to the SysDatabases table, therefore it is better to use it, instead of accessing the endpoint directly:

API Source - Cosmos DB
Read and write Azure Cosmos DB data effortlessly. Query, integrate, and manage databases, containers, documents, and users — almost no coding required.
Cosmos DB
SysDatabases
There are no parameters to configure.
SSIS API Source - Read from table or endpoint

API Destination

This Endpoint belongs to the SysDatabases table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to get list of databases:

API Destination - Cosmos DB
Read and write Azure Cosmos DB data effortlessly. Query, integrate, and manage databases, containers, documents, and users — almost no coding required.
Cosmos DB
SysDatabases
Select
There are no parameters to configure.
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

List databases

<p>Returns all databases in the Cosmos DB account. Use this to discover database names and IDs for connection defaults or for querying a specific database. Columns include <code>Id</code>, <code>ResourceId</code>, <code>LastUpdated</code>, and <code>ETag</code>.</p>

SELECT * FROM SysDatabases

get_databases endpoint belongs to SysDatabases table(s), and can therefore be used via those table(s).

SQL Server

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

List databases

<p>Returns all databases in the Cosmos DB account. Use this to discover database names and IDs for connection defaults or for querying a specific database. Columns include <code>Id</code>, <code>ResourceId</code>, <code>LastUpdated</code>, and <code>ETag</code>.</p>

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM SysDatabases';

EXEC (@MyQuery) AT [LS_TO_COSMOS_DB_IN_GATEWAY];

get_databases endpoint belongs to SysDatabases table(s), and can therefore be used via those table(s).