Endpoint Delete a Document by Id
Name
delete_document
Description
Deletes a Document by Id. [API reference]
Related Tables
Parameters
| Parameter | Required | Options | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Name: Label: Document Id | YES | |||||||||
| Name: Label: Table Name (Case-Sensitive) | YES | |||||||||
| Name: Label: Database Name (keep blank to use default) Case-SensitiveLeave blank to use default DB set on connection screen | ||||||||||
| Name: Label: EnableCrossPartition | 
 | |||||||||
| Name: Label: Partition Key Value (default is supplied Id)The partition key value for the document. Must be included if and only if the collection is created with a partitionKey definition | 
 | 
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | 
|---|---|---|---|---|
| Id | DT_WSTR | nvarchar(4000) | 4000 | |
| Status | DT_WSTR | nvarchar(4000) | 4000 | |
| Table | DT_WSTR | nvarchar(4000) | 4000 | |
| StatusCode | DT_I4 | int | 
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | 
|---|---|---|---|---|
| Id | DT_WSTR | nvarchar(4000) | 4000 | 
Examples
SSIS
Use Cosmos DB Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
| Required Parameters | |
|---|---|
| Document Id | Fill-in the parameter... | 
| Table Name (Case-Sensitive) | Fill-in the parameter... | 
| Optional Parameters | |
| Database Name (keep blank to use default) Case-Sensitive | |
| EnableCrossPartition | true | 
| Partition Key Value (default is supplied Id) | . | 
| RawOutputDataRowTemplate | {} | 
| EnableRawOutputModeSingleRow | True | 
| ContineOnErrorForStatusCode | True | 
| ErrorStatusCodeToMatchRegex | 404|405 | 
 
API Destination
This Endpoint belongs to the [Dynamic Table] table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to delete a document by id:
| Required Parameters | |
|---|---|
| Document Id | Fill-in the parameter... | 
| Table Name (Case-Sensitive) | Fill-in the parameter... | 
| Optional Parameters | |
| Database Name (keep blank to use default) Case-Sensitive | |
| EnableCrossPartition | true | 
| Partition Key Value (default is supplied Id) | . | 
| RawOutputDataRowTemplate | {} | 
| EnableRawOutputModeSingleRow | True | 
| ContineOnErrorForStatusCode | True | 
| ErrorStatusCodeToMatchRegex | 404|405 | 
 
ODBC application
Use these SQL queries in your ODBC application data source:
Delete a document by id
SELECT * FROM [dynamic_table_name]
WHERE Id = 'abcd-1234-id'
WITH
(
    "Table" = 'abcd-1234-table'
)
                delete_document endpoint belongs to
                    [Dynamic Table]
                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:
Delete a document by id
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM [dynamic_table_name]
WHERE Id = ''abcd-1234-id''
WITH
(
    "Table" = ''abcd-1234-table''
)';
EXEC (@MyQuery) AT [LS_TO_COSMOS_DB_IN_GATEWAY];
                delete_document endpoint belongs to
                    [Dynamic Table]
                table(s), and can therefore be used via those table(s).
            
 
            