Required. Name of the database where the query will be executed.
Note - Value provided should be the same as expected from SELECT
current_database(); and NOT as a resource reference.
Required. Database user to be used for executing the SQL.
Note - Value provided should be the same as expected from
SELECT current_user; and NOT as a resource reference.
[[["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\u003eThis document provides reference information for the \u003ccode\u003eExecuteSqlRequest\u003c/code\u003e class within the AlloyDB v1beta API for .NET, specifically version 1.0.0-beta09, which is the latest release.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExecuteSqlRequest\u003c/code\u003e class is used to send requests to execute SQL statements on an AlloyDB instance and implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eExecuteSqlRequest\u003c/code\u003e class include \u003ccode\u003eDatabase\u003c/code\u003e, \u003ccode\u003eInstance\u003c/code\u003e, \u003ccode\u003ePassword\u003c/code\u003e, \u003ccode\u003eSqlStatement\u003c/code\u003e, and \u003ccode\u003eUser\u003c/code\u003e, which are used to specify the target database, instance, credentials, SQL to execute, and the user, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExecuteSqlRequest\u003c/code\u003e class can be constructed using the default constructor or by copying the properties of another \u003ccode\u003eExecuteSqlRequest\u003c/code\u003e instance into a new object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eInstance\u003c/code\u003e and \u003ccode\u003eDatabase\u003c/code\u003e properties are required in order to execute SQL statements and need to be in the proper format, not as a resource reference.\u003c/p\u003e\n"]]],[],null,["# AlloyDB v1beta API - Class ExecuteSqlRequest (1.0.0-beta12)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta12 (latest)](/dotnet/docs/reference/Google.Cloud.AlloyDb.V1Beta/latest/Google.Cloud.AlloyDb.V1Beta.ExecuteSqlRequest)\n- [1.0.0-beta11](/dotnet/docs/reference/Google.Cloud.AlloyDb.V1Beta/1.0.0-beta11/Google.Cloud.AlloyDb.V1Beta.ExecuteSqlRequest) \n\n public sealed class ExecuteSqlRequest : IMessage\u003cExecuteSqlRequest\u003e, IEquatable\u003cExecuteSqlRequest\u003e, IDeepCloneable\u003cExecuteSqlRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the AlloyDB v1beta API class ExecuteSqlRequest.\n\nRequest for ExecuteSql rpc. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ExecuteSqlRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ExecuteSqlRequest](/dotnet/docs/reference/Google.Cloud.AlloyDb.V1Beta/latest/Google.Cloud.AlloyDb.V1Beta.ExecuteSqlRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ExecuteSqlRequest](/dotnet/docs/reference/Google.Cloud.AlloyDb.V1Beta/latest/Google.Cloud.AlloyDb.V1Beta.ExecuteSqlRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ExecuteSqlRequest](/dotnet/docs/reference/Google.Cloud.AlloyDb.V1Beta/latest/Google.Cloud.AlloyDb.V1Beta.ExecuteSqlRequest), [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.AlloyDb.V1Beta](/dotnet/docs/reference/Google.Cloud.AlloyDb.V1Beta/latest/Google.Cloud.AlloyDb.V1Beta)\n\nAssembly\n--------\n\nGoogle.Cloud.AlloyDb.V1Beta.dll\n\nConstructors\n------------\n\n### ExecuteSqlRequest()\n\n public ExecuteSqlRequest()\n\n### ExecuteSqlRequest(ExecuteSqlRequest)\n\n public ExecuteSqlRequest(ExecuteSqlRequest other)\n\nProperties\n----------\n\n### Database\n\n public string Database { get; set; }\n\nRequired. Name of the database where the query will be executed.\nNote - Value provided should be the same as expected from `SELECT\ncurrent_database();` and NOT as a resource reference.\n\n### HasPassword\n\n public bool HasPassword { get; }\n\nGets whether the \"password\" field is set\n\n### Instance\n\n public string Instance { get; set; }\n\nRequired. The instance where the SQL will be executed. For the required\nformat, see the comment on the Instance.name field.\n\n### InstanceAsInstanceName\n\n public InstanceName InstanceAsInstanceName { get; set; }\n\n[InstanceName](/dotnet/docs/reference/Google.Cloud.AlloyDb.V1Beta/latest/Google.Cloud.AlloyDb.V1Beta.InstanceName)-typed view over the [Instance](/dotnet/docs/reference/Google.Cloud.AlloyDb.V1Beta/latest/Google.Cloud.AlloyDb.V1Beta.ExecuteSqlRequest#Google_Cloud_AlloyDb_V1Beta_ExecuteSqlRequest_Instance) resource name property.\n\n### Password\n\n public string Password { get; set; }\n\nOptional. The database native user's password.\n\n### SqlStatement\n\n public string SqlStatement { get; set; }\n\nRequired. SQL statement to execute on database. Any valid statement is\npermitted, including DDL, DML, DQL statements.\n\n### User\n\n public string User { get; set; }\n\nRequired. Database user to be used for executing the SQL.\nNote - Value provided should be the same as expected from\n`SELECT current_user;` and NOT as a resource reference.\n\n### UserCredentialCase\n\n public ExecuteSqlRequest.UserCredentialOneofCase UserCredentialCase { get; }"]]