DocumentClient.CreateStoredProcedureAsync
Method
Definition
Overloads
| CreateStoredProcedureAsync(String, StoredProcedure, RequestOptions) |
Creates a stored procedure as an asychronous operation in the Azure DocumentDB database service. |
| CreateStoredProcedureAsync(Uri, StoredProcedure, RequestOptions) |
Creates a stored procedure as an asychronous operation in the Azure DocumentDB database service. |
CreateStoredProcedureAsync(String, StoredProcedure, RequestOptions)
Creates a stored procedure as an asychronous operation in the Azure DocumentDB database service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.StoredProcedure>> CreateStoredProcedureAsync (string collectionLink, Microsoft.Azure.Documents.StoredProcedure storedProcedure, Microsoft.Azure.Documents.Client.RequestOptions options = null);
- collectionLink
- String
The link of the collection to create the stored procedure in. E.g. dbs/db_rid/colls/col_rid/
- storedProcedure
- StoredProcedure
The StoredProcedure object to create.
- options
- RequestOptions
(Optional) Any RequestOptionsfor this request.
The StoredProcedure that was created contained within a Task object representing the service response for the asynchronous operation.
If either collectionLink or storedProcedure is not set.
Represents a consolidation of failures that occured during async processing. Look within InnerExceptions to find the actual exception(s)
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 |
|---|---|
| 400 | BadRequest - This means something was wrong with the request supplied. It is likely that an Id was not supplied for the stored procedure or the Body was malformed. |
| 403 | Forbidden - You have reached your quota of stored procedures for the collection supplied. Contact support to have this quota increased. |
| 409 | Conflict - This means a StoredProcedure with an id matching the id you supplied already existed. |
| 413 | RequestEntityTooLarge - This means the body of the StoredProcedure you tried to create was too large. |
CreateStoredProcedureAsync(Uri, StoredProcedure, RequestOptions)
Creates a stored procedure as an asychronous operation in the Azure DocumentDB database service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.StoredProcedure>> CreateStoredProcedureAsync (Uri documentCollectionUri, Microsoft.Azure.Documents.StoredProcedure storedProcedure, Microsoft.Azure.Documents.Client.RequestOptions options = null);
- documentCollectionUri
- Uri
the URI of the document collection to create the stored procedure in.
- storedProcedure
- StoredProcedure
the Microsoft.Azure.Documents.StoredProcedure object.
- options
- RequestOptions
The request options for the request.
The task object representing the service response for the asynchronous operation.