# Google BigQuery v2 API - Class BigQueryInsertResults (3.12.0)

3.12.0 (latest) 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.4.0 2.3.0 2.2.0

    public sealed class BigQueryInsertResults

Reference documentation and code samples for the Google BigQuery v2 API class BigQueryInsertResults.

The results obtained after an insertion attempt.
This will contain information on invalid rows if any.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> BigQueryInsertResults

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.BigQuery.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2)

## Assembly

Google.Cloud.BigQuery.V2.dll

## Constructors

### BigQueryInsertResults(BigQueryClient, InsertOptions, IReadOnlyList\<BigQueryInsertRow\>, TableDataInsertAllResponse)

    public BigQueryInsertResults(BigQueryClient client, InsertOptions options, IReadOnlyList<BigQueryInsertRow> originalRows, TableDataInsertAllResponse insertResponse)

Constructs a new set of insert results.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `client` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient` The client used for the insert request. Must not be null. |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.InsertOptions` The options used for the insert request. May be null. |
| `originalRows` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertRow` The rows whose insert was attempted. Must not be null. |
| `insertResponse` | `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.TableDataInsertAllResponse.html` The response obtained after attempting the insert. Must not be null. |

## Properties

### Errors

    public IEnumerable<BigQueryInsertRowErrors> Errors { get; }

Returns a sequence over rows with insert errors.
Each element represents a row with possibly multiple errors associated to it.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertRowErrors` | A sequence over rows with insert errors. Will never be null. |

### InsertAttemptRowCount

    public int InsertAttemptRowCount { get; }

The amount of rows that were attempted in the insert operation.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### OriginalRowsWithErrors

    public int OriginalRowsWithErrors { get; }

The number of rows with reported errors in [Errors](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertResults#Google_Cloud_BigQuery_V2_BigQueryInsertResults_Errors).
Note that it's possible that some errors are not associated to
any particular row so this number might be smaller than the number
of elements in [Errors](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertResults#Google_Cloud_BigQuery_V2_BigQueryInsertResults_Errors).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### Status

    public BigQueryInsertStatus Status { get; }

Status of the insert request.
See [BigQueryInsertStatus](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertStatus) for a detailed explanation.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertStatus` |   |

## Methods

### ThrowOnAnyError()

    public BigQueryInsertResults ThrowOnAnyError()

Throws [GoogleApiException](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.GoogleApiException.html) if there were insert errors.
The exception will contain details of these errors.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertResults` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.GoogleApiException.html` | There were insert errors. |

### ThrowOnNoneInserted()

    public BigQueryInsertResults ThrowOnNoneInserted()

Throws [GoogleApiException](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.GoogleApiException.html) if no row was inserted.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertResults` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.GoogleApiException.html` | No row was inserted. |

### ThrowOnNotAllInserted()

    public BigQueryInsertResults ThrowOnNotAllInserted()

Throws [GoogleApiException](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.GoogleApiException.html) if not all rows were inserted.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertResults` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.GoogleApiException.html` | Not all rows were inserted. |