SQL examples for ODBC
The following SQL examples demonstrate common use cases for this connector. Select a scenario below to view the query syntax and parameters required to interact with Cosmos DB.
- Create document from file path
- Create document with partition key
- Get document by ID
- List all documents in a container
- List containers (tables)
- List containers for a database
- List databases
- List users
- Partial update document (PATCH)
- Partial update document (PATCH) from file
- Query documents (default container)
- Query documents with Cosmos DB SQL
- Update document (full replace)
- Upsert document (insert or update if exists)
- Upsert document using UPSERT keyword