Managed Database Queries - Get

Get query by query id.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}?api-version=2021-11-01

URI Parameters

Name In Required Type Description
databaseName
path True

string

The name of the database.

managedInstanceName
path True

string

The name of the managed instance.

queryId
path True

string

resourceGroupName
path True

string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Responses

Name Type Description
200 OK

ManagedInstanceQuery

Successfully retrieved query text.

Other Status Codes

*** Error Responses: ***

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 ResourceNotFound - The requested resource was not found.

Examples

Obtain query properties

Sample request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/databases/database_1/queries/42?api-version=2021-11-01

Sample response

{
  "id": "42",
  "type": "Microsoft.Sql/managedInstances/databases/queries",
  "properties": {
    "queryText": "select * from DUMMY_TABLE"
  }
}

Definitions

ManagedInstanceQuery

Database query.

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.queryText

string

Query text.

type

string

Resource type.