Each parameter has a name, type and value. Names are irrelevant for queries using
positional parameters. All scalar types are converted into strings
before being passed to the server, but the nature of the conversion depends on the specified type.
The following list shows the correspondence between the parameter type and valid value types.
All scalar types may be specified as a string value, which will not be validated or converted on the client,
but passed to the API as-is.
Array: An IReadOnlyList<T> of any of the above types corresponding to the ArrayElementType,
which will be inferred from the value's element type if not otherwise specified.
If the parameter type is null, it is inferred from the value. A TimeSpan value is
always assumed to be a Time, a DateTimeOffset value is
always assumed to be a Timestamp, and a DateTime value is assumed
to be DateTime regardless of its Kind.
If an array parameter doesn't specify the array type, the type is inferred from the type of the value.
Array parameters must not have a value of null, and all the elements must be non-null as well.
The type of the parameter. If this is null, the type of the parameter is inferred from the value.
Otherwise, the value must be of one of the supported types for the parameter type. See the class documentation
for details.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis page provides reference documentation for the \u003ccode\u003eBigQueryParameter\u003c/code\u003e class within the Google BigQuery v2 API, detailing its usage in SQL queries.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBigQueryParameter\u003c/code\u003e class allows for the definition of query parameters with a name, type, and value, with the ability to infer the type from the provided value if not specified.\u003c/p\u003e\n"],["\u003cp\u003eVarious constructors are available for \u003ccode\u003eBigQueryParameter\u003c/code\u003e, supporting parameters with or without a name, type, and value.\u003c/p\u003e\n"],["\u003cp\u003eThe class supports different data types, including scalar types like \u003ccode\u003eBool\u003c/code\u003e, \u003ccode\u003eInt64\u003c/code\u003e, and \u003ccode\u003eString\u003c/code\u003e, as well as complex types like \u003ccode\u003eArray\u003c/code\u003e and \u003ccode\u003eDateTime\u003c/code\u003e, with specific valid value types for each parameter type.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation shows a version history of the parameter, with version 3.11.0 as the latest.\u003c/p\u003e\n"]]],[],null,["# Google BigQuery v2 API - Class BigQueryParameter (3.11.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.11.0 (latest)](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.10.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.9.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.8.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.7.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.6.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.5.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.4.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.3.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.2.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.1.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.0.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/2.4.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/2.3.0/Google.Cloud.BigQuery.V2.BigQueryParameter)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/2.2.0/Google.Cloud.BigQuery.V2.BigQueryParameter) \n\n public sealed class BigQueryParameter\n\nReference documentation and code samples for the Google BigQuery v2 API class BigQueryParameter.\n\nA parameter within a SQL query. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BigQueryParameter \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.BigQuery.V2](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.BigQuery.V2.dll\n\nRemarks\n-------\n\n\nEach parameter has a name, type and value. Names are irrelevant for queries using\npositional parameters. All scalar types are converted into strings\nbefore being passed to the server, but the nature of the conversion depends on the specified type.\n\n\nThe following list shows the correspondence between the parameter type and valid value types.\nAll scalar types may be specified as a string value, which will not be validated or converted on the client,\nbut passed to the API as-is.\n\n- `Bool`: `System.Boolean`\n- `Int64`: `System.Int16`, `System.Int32`, `System.Int64`, `System.UInt16`, `System.UInt32`, `System.UInt64`\n- `Float64`: Any type valid for `Int64`, as well as `System.Single` and `System.Double`\n- `String`: `System.String`\n- `Bytes`: `System.Byte[]`\n- `Date`: `System.DateTime`, `System.DateTimeOffset`\n- `DateTime`: `System.DateTime`, `System.DateTimeOffset`\n- `Time`: `System.DateTime`, `System.DateTimeOffset`, `System.TimeSpan`\n- `Timestamp`: `System.DateTime`, `System.DateTimeOffset`\n- `Numeric`: `Google.Cloud.BigQuery.V1.BigQueryNumeric`\n- `Geography`: `Google.Cloud.BigQuery.V1.BigQueryGeography`\n- `Json`: `System.String`\n- `Array`: An `IReadOnlyList\u003cT\u003e` of any of the above types corresponding to the [ArrayElementType](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryParameter#Google_Cloud_BigQuery_V2_BigQueryParameter_ArrayElementType), which will be inferred from the value's element type if not otherwise specified.\n\n\nIf the parameter type is null, it is inferred from the value. A [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan) value is\nalways assumed to be a [Time](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryDbType#Google_Cloud_BigQuery_V2_BigQueryDbType_Time), a [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset) value is\nalways assumed to be a [Timestamp](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryDbType#Google_Cloud_BigQuery_V2_BigQueryDbType_Timestamp), and a [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) value is assumed\nto be [DateTime](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryDbType#Google_Cloud_BigQuery_V2_BigQueryDbType_DateTime) regardless of its [Kind](https://learn.microsoft.com/dotnet/api/system.datetime.kind).\n\n\nIf an array parameter doesn't specify the array type, the type is inferred from the type of the value.\n\n\nArray parameters must not have a value of null, and all the elements must be non-null as well.\n\n\nIf a [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) value is provided for a [Timestamp](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryDbType#Google_Cloud_BigQuery_V2_BigQueryDbType_Timestamp) parameter, the\nvalue must have a [Kind](https://learn.microsoft.com/dotnet/api/system.datetime.kind) of [Utc](https://learn.microsoft.com/dotnet/api/system.datetimekind#system-datetimekind-utc).\n\n\nStruct parameters are currently not supported.\n\nConstructors\n------------\n\n### BigQueryParameter()\n\n public BigQueryParameter()\n\nConstructs a parameter with no name, initial value or type.\n\n### BigQueryParameter(BigQueryDbType)\n\n public BigQueryParameter(BigQueryDbType type)\n\nConstructs a parameter with no name, initial value or type.\n\n### BigQueryParameter(BigQueryDbType?, object)\n\n public BigQueryParameter(BigQueryDbType? type, object value)\n\nConstructs a parameter with no name, and the specified type and value.\n\n### BigQueryParameter(string)\n\n public BigQueryParameter(string name)\n\nConstructs a parameter with the given name but no initial value or type.\n\n### BigQueryParameter(string, BigQueryDbType?)\n\n public BigQueryParameter(string name, BigQueryDbType? type)\n\nConstructs a parameter with the given name and type, but no initial value.\n\n### BigQueryParameter(string, BigQueryDbType?, object)\n\n public BigQueryParameter(string name, BigQueryDbType? type, object value)\n\nConstructs a parameter with the given name, type and value.\n\nProperties\n----------\n\n### ArrayElementType\n\n public BigQueryDbType? ArrayElementType { get; set; }\n\nThe type of the nested elements, for array parameters. If this is null, the type is inferred from the value.\n\n### Name\n\n public string Name { get; set; }\n\nThe name of the parameter. This is irrelevant for positional parameters.\n\n### Type\n\n public BigQueryDbType? Type { get; set; }\n\nThe type of the parameter. If this is null, the type of the parameter is inferred from the value.\nOtherwise, the value must be of one of the supported types for the parameter type. See the [class documentation](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryParameter)\nfor details.\n\n### Value\n\n public object Value { get; set; }\n\nThe value of the parameter. If this is null, the type of the parameter must be specified\nexplicitly."]]