IDocumentClient.DeleteStoredProcedureAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
DeleteStoredProcedureAsync(String, RequestOptions) |
Delete a StoredProcedure from the Azure Cosmos DB service as an asynchronous operation. |
DeleteStoredProcedureAsync(Uri, RequestOptions) |
Delete a stored procedure as an asynchronous operation in the Azure Cosmos DB service. |
DeleteStoredProcedureAsync(String, RequestOptions)
Delete a StoredProcedure from the Azure Cosmos DB service as an asynchronous operation.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.StoredProcedure>> DeleteStoredProcedureAsync (string storedProcedureLink, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeleteStoredProcedureAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.StoredProcedure>>
Public Function DeleteStoredProcedureAsync (storedProcedureLink As String, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of StoredProcedure))
Parameters
- storedProcedureLink
- String
The link of the StoredProcedure to delete. E.g. dbs/db_rid/colls/col_rid/sprocs/sproc_rid/
- options
- RequestOptions
(Optional) The request options for the request.
Returns
A System.Threading.Tasks containing a ResourceResponse<TResource> which will contain information about the request issued.
Exceptions
If storedProcedureLink
is not set.
This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a Document are:
StatusCode | Reason for exception |
---|---|
404 | NotFound - This means the resource you tried to delete did not exist. |
Examples
//Delete a stored procedure using its selfLink property.
//To get the sprocLink you would have to query for the Stored Procedure, using CreateStoredProcedureQuery(), and then refer to its .SelfLink property
await client.DeleteStoredProcedureAsync(sprocLink);
See also
Applies to
DeleteStoredProcedureAsync(Uri, RequestOptions)
Delete a stored procedure as an asynchronous operation in the Azure Cosmos DB service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.StoredProcedure>> DeleteStoredProcedureAsync (Uri storedProcedureUri, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeleteStoredProcedureAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.StoredProcedure>>
Public Function DeleteStoredProcedureAsync (storedProcedureUri As Uri, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of StoredProcedure))
Parameters
- storedProcedureUri
- Uri
The URI of the stored procedure to delete.
- options
- RequestOptions
(Optional) The RequestOptions for the request.
Returns
The task object representing the service response for the asynchronous operation.