Microsoft.Azure.SqlDatabase.ElasticScale.Query Namespace

Contains classes that support access to attributes of a query.



Represents one or more System.Exception errors that occured when executing a query across a shard set. The InnerExceptions field collects these exceptions and one can iterate through the InnerExceptions for further inspection or processing.


Complements the MultiShardConnection with a command object similar to the triad of System.Data.SqlClient.SqlConnection, System.Data.SqlClient.SqlCommand, and System.Data.SqlClient.SqlDataReader. The MultiShardCommand takes a T-SQL command statement as its input and executes the command across its collection of shards specified by its corresponding MultiShardConnection. The results from processing the MultiShardCommand are made available through the execute methods and the MultiShardDataReader.


Represents a connection to a set of shards and provides the ability to process queries across the shard set.


Provides a way of reading a forward-only stream of rows that is retrieved from a shard set.


Custom exception to throw when the MultiShardDataReader is closed and the user attempts to perform an operation on the closed reader.


Custom exception that is thrown when the MultiShardDataReader is in an invalid state. If you experience this exception repeatedly, please contact Microsoft Customer Support.


A MultiShardException represents an exception that occured when performing operations against a shard. It provides information about both the identity of the shard and the expection that occurred. Depending on the nature of the exception, one can try re-running the multi-shard query, execute a separate query targeted directly at the shard(s) on that yielded the expection, or lastly execute the query manually against the shard using a common tool such as SSMS.


The MultiShardDataReader throws this exception when an exception has been hit reading data from one of the underlying shards. This indicates that not all rows have been successfully retrieved from the targeted shard(s). Users can then take the steps necessary to decide whether to re-run the query, or whether to continue working with the rows that have already been retrieved.


Custom exception thrown when the schema on at least one of the shards participating in the overall query does not conform to the expected schema for the multi-shard query as a whole.


Input to be passed to per-shard event handlers.



Defines the available options when executing commands against multiple shards


Defines the possible query execution policies