Class Batch
This class represents a batch within a query
Inheritance
Inherited Members
Namespace:Microsoft.SqlTools.ServiceLayer.QueryExecution
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public class Batch : IDisposable
Properties
| Improve this Doc View SourceBatchText
The text of batch that will be executed
Declaration
public string BatchText { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ExecutionElapsedTime
Localized timestamp for how long it took for the execution to complete
Declaration
public string ExecutionElapsedTime { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ExecutionEndTimeStamp
Localized timestamp for when the execution completed. Stored in UTC ISO 8601 format; should be localized before displaying to any user
Declaration
public string ExecutionEndTimeStamp { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ExecutionStartTimeStamp
Localized timestamp for when the execution began. Stored in UTC ISO 8601 format; should be localized before displaying to any user
Declaration
public string ExecutionStartTimeStamp { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
HasError
Whether or not this batch has an error
Declaration
public bool HasError { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasExecuted
Whether or not this batch has been executed, regardless of success or failure
Declaration
public bool HasExecuted { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Id
Ordinal of the batch in the query
Declaration
public int Id { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
ResultMessages
Messages that have come back from the server
Declaration
public IEnumerable<ResultMessage> ResultMessages { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<ResultMessage> |
ResultSets
The result sets of the batch execution
Declaration
public IList<ResultSet> ResultSets { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IList<ResultSet> |
ResultSummaries
Property for generating a set result set summaries from the result sets
Declaration
public ResultSetSummary[] ResultSummaries { get; }
Property Value
| Type | Description |
|---|---|
| ResultSetSummary[] |
Summary
Creates a BatchSummary based on the batch instance
Declaration
public BatchSummary Summary { get; }
Property Value
| Type | Description |
|---|---|
| BatchSummary |
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()
Implements
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
Execute(DbConnection, CancellationToken)
Executes this batch and captures any server messages that are returned.
Declaration
public Task Execute(DbConnection conn, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Data.Common.DbConnection | conn | The connection to use to execute the batch |
| System.Threading.CancellationToken | cancellationToken | Token for cancelling the execution |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
GetSubset(Int32, Int32, Int32)
Generates a subset of the rows from a result set of the batch
Declaration
public Task<ResultSetSubset> GetSubset(int resultSetIndex, int startRow, int rowCount)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | resultSetIndex | The index for selecting the result set |
| System.Int32 | startRow | The starting row of the results |
| System.Int32 | rowCount | How many rows to retrieve |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultSetSubset> | A subset of results |
Events
| Improve this Doc View SourceBatchCompletion
Event that will be called when the batch has completed execution
Declaration
public event Batch.BatchAsyncEventHandler BatchCompletion
Event Type
| Type | Description |
|---|---|
| Batch.BatchAsyncEventHandler |
BatchStart
Event to call when the batch has started execution
Declaration
public event Batch.BatchAsyncEventHandler BatchStart
Event Type
| Type | Description |
|---|---|
| Batch.BatchAsyncEventHandler |
ResultSetCompletion
Event that will be called when the resultset has completed execution. It will not be called from the Batch but from the ResultSet instance
Declaration
public event ResultSet.ResultSetAsyncEventHandler ResultSetCompletion
Event Type
| Type | Description |
|---|---|
| ResultSet.ResultSetAsyncEventHandler |