public sealed class ExecuteBatchDmlResponse : IMessage<ExecuteBatchDmlResponse>, IEquatable<ExecuteBatchDmlResponse>, IDeepCloneable<ExecuteBatchDmlResponse>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Spanner v1 API class ExecuteBatchDmlResponse.
The response for
[ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list
of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML
statement that has successfully executed, in the same order as the statements
in the request. If a statement fails, the status in the response body
identifies the cause of the failure.
To check for DML statements that failed, use the following approach:
Check the status in the response message. The
[google.rpc.Code][google.rpc.Code] enum
value OK indicates that all statements were executed successfully.
If the status was not OK, check the number of result sets in the
response. If the response contains N
[ResultSet][google.spanner.v1.ResultSet] messages, then statement N+1 in
the request failed.
Example 1:
Request: 5 DML statements, all executed successfully.
Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the
status OK.
Example 2:
Request: 5 DML statements. The third statement has a syntax error.
Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax
error (INVALID_ARGUMENT)
status. The number of [ResultSet][google.spanner.v1.ResultSet] messages
indicates that the third statement failed, and the fourth and fifth
statements were not executed.
public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }
Optional. A precommit token will be included if the read-write transaction
is on a multiplexed session.
The precommit token with the highest sequence number from this transaction
attempt should be passed to the
[Commit][google.spanner.v1.Spanner.Commit] request for this transaction.
This feature is not yet supported and will result in an UNIMPLEMENTED
error.
public RepeatedField<ResultSet> ResultSets { get; }
One [ResultSet][google.spanner.v1.ResultSet] for each statement in the
request that ran successfully, in the same order as the statements in the
request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any
rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each
[ResultSet][google.spanner.v1.ResultSet] contain the number of rows
modified by the statement.
Only the first [ResultSet][google.spanner.v1.ResultSet] in the response
contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata].
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eExecuteBatchDmlResponse\u003c/code\u003e class represents the response from executing a batch of DML statements in the Google Cloud Spanner v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this class is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, with several previous versions also available for reference, as far back as \u003ccode\u003e3.5.0\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful execution of all statements in the batch is indicated by an \u003ccode\u003eOK\u003c/code\u003e status; otherwise, the \u003ccode\u003eStatus\u003c/code\u003e property will provide the error of the first failed statement.\u003c/p\u003e\n"],["\u003cp\u003eThe response contains a \u003ccode\u003eResultSet\u003c/code\u003e for each successfully executed statement, ordered as they were in the original request, while the number of result sets indicates which statement failed if there was any.\u003c/p\u003e\n"],["\u003cp\u003eThe PrecommitToken property of the class will be included when the transaction is on a multiplexed session, and it should be passed to the Commit request, although it is not yet supported.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner v1 API - Class ExecuteBatchDmlResponse (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/5.0.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.6.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.5.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.4.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.3.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.2.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.1.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.0.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.15.1/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.14.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.13.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.12.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.11.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.10.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.9.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.8.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.7.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.6.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.5.0/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse) \n\n public sealed class ExecuteBatchDmlResponse : IMessage\u003cExecuteBatchDmlResponse\u003e, IEquatable\u003cExecuteBatchDmlResponse\u003e, IDeepCloneable\u003cExecuteBatchDmlResponse\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Spanner v1 API class ExecuteBatchDmlResponse.\n\nThe response for\n\\[ExecuteBatchDml\\]\\[google.spanner.v1.Spanner.ExecuteBatchDml\\]. Contains a list\nof \\[ResultSet\\]\\[google.spanner.v1.ResultSet\\] messages, one for each DML\nstatement that has successfully executed, in the same order as the statements\nin the request. If a statement fails, the status in the response body\nidentifies the cause of the failure.\n\nTo check for DML statements that failed, use the following approach:\n\n1. Check the status in the response message. The \\[google.rpc.Code\\]\\[google.rpc.Code\\] enum value `OK` indicates that all statements were executed successfully.\n2. If the status was not `OK`, check the number of result sets in the response. If the response contains `N` \\[ResultSet\\]\\[google.spanner.v1.ResultSet\\] messages, then statement `N+1` in the request failed.\n\nExample 1:\n\n- Request: 5 DML statements, all executed successfully.\n- Response: 5 \\[ResultSet\\]\\[google.spanner.v1.ResultSet\\] messages, with the status `OK`.\n\nExample 2:\n\n- Request: 5 DML statements. The third statement has a syntax error.\n- Response: 2 \\[ResultSet\\]\\[google.spanner.v1.ResultSet\\] messages, and a syntax error (`INVALID_ARGUMENT`) status. The number of \\[ResultSet\\]\\[google.spanner.v1.ResultSet\\] messages indicates that the third statement failed, and the fourth and fifth statements were not executed. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ExecuteBatchDmlResponse \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ExecuteBatchDmlResponse](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ExecuteBatchDmlResponse](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ExecuteBatchDmlResponse](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ExecuteBatchDmlResponse), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.V1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.V1.dll\n\nConstructors\n------------\n\n### ExecuteBatchDmlResponse()\n\n public ExecuteBatchDmlResponse()\n\n### ExecuteBatchDmlResponse(ExecuteBatchDmlResponse)\n\n public ExecuteBatchDmlResponse(ExecuteBatchDmlResponse other)\n\nProperties\n----------\n\n### PrecommitToken\n\n public MultiplexedSessionPrecommitToken PrecommitToken { get; set; }\n\nOptional. A precommit token will be included if the read-write transaction\nis on a multiplexed session.\nThe precommit token with the highest sequence number from this transaction\nattempt should be passed to the\n\\[Commit\\]\\[google.spanner.v1.Spanner.Commit\\] request for this transaction.\nThis feature is not yet supported and will result in an UNIMPLEMENTED\nerror.\n\n### ResultSets\n\n public RepeatedField\u003cResultSet\u003e ResultSets { get; }\n\nOne \\[ResultSet\\]\\[google.spanner.v1.ResultSet\\] for each statement in the\nrequest that ran successfully, in the same order as the statements in the\nrequest. Each \\[ResultSet\\]\\[google.spanner.v1.ResultSet\\] does not contain any\nrows. The \\[ResultSetStats\\]\\[google.spanner.v1.ResultSetStats\\] in each\n\\[ResultSet\\]\\[google.spanner.v1.ResultSet\\] contain the number of rows\nmodified by the statement.\n\nOnly the first \\[ResultSet\\]\\[google.spanner.v1.ResultSet\\] in the response\ncontains valid \\[ResultSetMetadata\\]\\[google.spanner.v1.ResultSetMetadata\\].\n\n### Status\n\n public Status Status { get; set; }\n\nIf all DML statements are executed successfully, the status is `OK`.\nOtherwise, the error status of the first failed statement."]]