The data within the resource may be incomplete, depending on how it was obtained,
because for both get and list operations, a read mask can be specified that determines
which fields are populated on the returned resource.
Methods
Delete(DeleteRoutineOptions)
public void Delete(DeleteRoutineOptions options = null)
This method delegates to UpdateRoutine(RoutineReference, Routine, UpdateRoutineOptions).
A simple way of updating the routine is to modify Resource and then call this method with no arguments.
This is convenient, but it's important to understand that modifying Resource in this way leaves this object
in an unusual state - it represents "the table as it was when fetched, but then modified locally". For example, the etag
will be the original etag, rather than the one associated with the updated routine. To avoid this causing confusion,
we recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method
as the new, self-consistent representation of the routine.
A task representing the asynchronous operation. When complete, the result is
the updated routine.
Remarks
This method delegates to UpdateRoutineAsync(RoutineReference, Routine, UpdateRoutineOptions, CancellationToken).
A simple way of updating the routine is to modify Resource and then call this method with no arguments.
This is convenient, but it's important to understand that modifying Resource in this way leaves this object
in an unusual state - it represents "the table as it was when fetched, but then modified locally". For example, the etag
will be the original etag, rather than the one associated with the updated routine. To avoid this causing confusion,
we recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method
as the new, self-consistent representation of the routine.
[[["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\u003eThe \u003ccode\u003eBigQueryRoutine\u003c/code\u003e class in the Google BigQuery v2 API represents a routine within a BigQuery dataset, and it is available in multiple versions with the latest being 3.11.0.\u003c/p\u003e\n"],["\u003cp\u003eThis class allows for routine-oriented operations by wrapping the underlying REST API resource and retaining a reference to the original client.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBigQueryRoutine\u003c/code\u003e class has constructors, properties like \u003ccode\u003eFullyQualifiedId\u003c/code\u003e, \u003ccode\u003eReference\u003c/code\u003e, and \u003ccode\u003eResource\u003c/code\u003e, and methods like \u003ccode\u003eDelete\u003c/code\u003e, \u003ccode\u003eDeleteAsync\u003c/code\u003e, \u003ccode\u003eUpdate\u003c/code\u003e, and \u003ccode\u003eUpdateAsync\u003c/code\u003e, for managing routines.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUpdate\u003c/code\u003e and \u003ccode\u003eUpdateAsync\u003c/code\u003e methods allow modifying the routine's resource, but it is recommended to use the updated routine returned by these methods to avoid an inconsistent object state.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBigQueryRoutine\u003c/code\u003e objects can be constructed with a \u003ccode\u003eBigQueryClient\u003c/code\u003e and a \u003ccode\u003eRoutine\u003c/code\u003e resource, but normally, production code should not construct these instances directly.\u003c/p\u003e\n"]]],[],null,["# Google BigQuery v2 API - Class BigQueryRoutine (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.BigQueryRoutine)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.10.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.9.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.8.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.7.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.6.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.5.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.4.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.3.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.2.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.1.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.0.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/2.4.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/2.3.0/Google.Cloud.BigQuery.V2.BigQueryRoutine)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/2.2.0/Google.Cloud.BigQuery.V2.BigQueryRoutine) \n\n public sealed class BigQueryRoutine\n\nReference documentation and code samples for the Google BigQuery v2 API class BigQueryRoutine.\n\nA routine within a BigQuery dataset. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BigQueryRoutine \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\nThis class wraps the underlying REST API resource and retains a reference to the original\nclient, allowing for simpler routine-oriented operations.\n\nConstructors\n------------\n\n### BigQueryRoutine(BigQueryClient, Routine)\n\n public BigQueryRoutine(BigQueryClient client, Routine resource)\n\nConstructs a new routine.\n\n**Remarks** \nThis is public to allow tests to construct instances for production code to consume;\nproduction code should not normally construct instances itself.\n\nProperties\n----------\n\n### FullyQualifiedId\n\n public string FullyQualifiedId { get; }\n\nThe fully-qualified identifier for the routine in a string form of `project.dataset.routine`.\n\n### Reference\n\n public RoutineReference Reference { get; }\n\nThe fully-qualified identifier for the routine, as an object which can be used for other operations\nwithin this API.\n\n**Remarks** \nThe properties within the reference can be used to determine the project ID,\ndataset ID and routine ID components.\n\n### Resource\n\n public Routine Resource { get; }\n\nThe underlying REST-ful resource for the routine.\n\n**Remarks** \nThe data within the resource may be incomplete, depending on how it was obtained,\nbecause for both get and list operations, a read mask can be specified that determines\nwhich fields are populated on the returned resource.\n\nMethods\n-------\n\n### Delete(DeleteRoutineOptions)\n\n public void Delete(DeleteRoutineOptions options = null)\n\nDeletes this routine.\nThis method just creates a [RoutineReference](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.68.0.3400/api/Google.Apis.Bigquery.v2.Data.RoutineReference.html) and delegates to [DeleteRoutine(RoutineReference, DeleteRoutineOptions)](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_DeleteRoutine_Google_Apis_Bigquery_v2_Data_RoutineReference_Google_Cloud_BigQuery_V2_DeleteRoutineOptions_).\n\n### DeleteAsync(DeleteRoutineOptions, CancellationToken)\n\n public Task DeleteAsync(DeleteRoutineOptions options = null, CancellationToken cancellationToken = default)\n\nAsynchronously deletes this routine.\nThis method just creates a [RoutineReference](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.68.0.3400/api/Google.Apis.Bigquery.v2.Data.RoutineReference.html) and delegates to [DeleteRoutineAsync(RoutineReference, DeleteRoutineOptions, CancellationToken)](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_DeleteRoutineAsync_Google_Apis_Bigquery_v2_Data_RoutineReference_Google_Cloud_BigQuery_V2_DeleteRoutineOptions_System_Threading_CancellationToken_).\n\n### Update(Routine, UpdateRoutineOptions)\n\n public BigQueryRoutine Update(Routine resource = null, UpdateRoutineOptions options = null)\n\nUpdates this routine to match the specified resource.\n\n**Remarks** \nThis method delegates to [UpdateRoutine(RoutineReference, Routine, UpdateRoutineOptions)](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_UpdateRoutine_Google_Apis_Bigquery_v2_Data_RoutineReference_Google_Apis_Bigquery_v2_Data_Routine_Google_Cloud_BigQuery_V2_UpdateRoutineOptions_).\nA simple way of updating the routine is to modify [Resource](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryRoutine#Google_Cloud_BigQuery_V2_BigQueryRoutine_Resource) and then call this method with no arguments.\nThis is convenient, but it's important to understand that modifying [Resource](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryRoutine#Google_Cloud_BigQuery_V2_BigQueryRoutine_Resource) in this way leaves this object\nin an unusual state - it represents \"the table as it was when fetched, but then modified locally\". For example, the etag\nwill be the original etag, rather than the one associated with the updated routine. To avoid this causing confusion,\nwe recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method\nas the new, self-consistent representation of the routine.\n\n### UpdateAsync(Routine, UpdateRoutineOptions, CancellationToken)\n\n public Task\u003cBigQueryRoutine\u003e UpdateAsync(Routine resource = null, UpdateRoutineOptions options = null, CancellationToken cancellationToken = default)\n\nAsynchronously updates this routine to match the specified resource.\n\n**Remarks** \nThis method delegates to [UpdateRoutineAsync(RoutineReference, Routine, UpdateRoutineOptions, CancellationToken)](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_UpdateRoutineAsync_Google_Apis_Bigquery_v2_Data_RoutineReference_Google_Apis_Bigquery_v2_Data_Routine_Google_Cloud_BigQuery_V2_UpdateRoutineOptions_System_Threading_CancellationToken_).\nA simple way of updating the routine is to modify [Resource](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryRoutine#Google_Cloud_BigQuery_V2_BigQueryRoutine_Resource) and then call this method with no arguments.\nThis is convenient, but it's important to understand that modifying [Resource](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryRoutine#Google_Cloud_BigQuery_V2_BigQueryRoutine_Resource) in this way leaves this object\nin an unusual state - it represents \"the table as it was when fetched, but then modified locally\". For example, the etag\nwill be the original etag, rather than the one associated with the updated routine. To avoid this causing confusion,\nwe recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method\nas the new, self-consistent representation of the routine."]]