Table of Contents

Class SqlParameter

Namespace
Microsoft.Azure.Documents
Assembly
Microsoft.Azure.Documents.Client.dll

Represents a parameter associated with SqlQuerySpec in the Azure Cosmos DB service.

[DataContract]
public sealed class SqlParameter
Inheritance
SqlParameter
Inherited Members
Extension Methods

Remarks

Azure Cosmos DB SQL parameters are name-value pairs referenced in parameterized queries. Unlike in relation SQL databases, they don't have types associated with them.

Constructors

SqlParameter()

Initializes a new instance of the SqlParameter class for the Azure Cosmos DB service.

public SqlParameter()

SqlParameter(string)

Initializes a new instance of the SqlParameter class with the name of the parameter for the Azure Cosmos DB service.

public SqlParameter(string name)

Parameters

name string

The name of the parameter.

Remarks

Names of parameters must begin with '@' and be a valid SQL identifier.

SqlParameter(string, object)

Initializes a new instance of the SqlParameter class with the name and value of the parameter for the Azure Cosmos DB service.

public SqlParameter(string name, object value)

Parameters

name string

The name of the parameter.

value object

The value of the parameter.

Remarks

Names of parameters must begin with '@' and be a valid SQL identifier. The value gets serialized and passed in as JSON to the document query.

Properties

Name

Gets or sets the name of the parameter for the Azure Cosmos DB service.

[DataMember(Name = "name")]
public string Name { get; set; }

Property Value

string

The name of the parameter.

Remarks

Names of parameters must begin with '@' and be a valid SQL identifier.

Value

Gets or sets the value of the parameter for the Azure Cosmos DB service.

[DataMember(Name = "value")]
public object Value { get; set; }

Property Value

object

The value of the parameter.

Remarks

The value gets serialized and passed in as JSON to the document query.