Share via


Managed Database Columns - List By Table

List managed database columns

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns?api-version=2023-08-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns?$filter={$filter}&api-version=2023-08-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.

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.

schemaName
path True

string

The name of the schema.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

tableName
path True

string

The name of the table.

api-version
query True

string

The API version to use for the request.

$filter
query

string

An OData filter expression that filters elements in the collection.

Responses

Name Type Description
200 OK

DatabaseColumnListResult

Successfully retrieved managed database columns.

Other Status Codes

ErrorResponse

*** Error Responses: ***

  • 400 UpdateNotAllowedOnPausedDatabase - User attempted to perform an update on a paused database.

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

  • 404 SourceDatabaseNotFound - The source database does not exist.

  • 404 ResourceDoesNotExist - Resource with the name '{0}' does not exist. To continue, specify a valid resource name.

  • 404 InvalidDatabaseSchema - Schema is missing in database.

  • 404 InvalidDatabaseTable - Table is missing in database.

  • 404 InvalidDatabaseColumn - Column is missing in table.

  • 503 DatabaseUnavailable - The operation failed because the database is unavailable.

Examples

List managed database columns

Sample request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/table1/columns?api-version=2023-08-01

Sample response

{
  "value": [
    {
      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/table1/columns/col1",
      "name": "col1",
      "type": "Microsoft.Sql/managedInstances/databases/schemas/tables/columns",
      "properties": {
        "columnType": "nvarchar"
      }
    },
    {
      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/table1/columns/col2",
      "name": "col2",
      "type": "Microsoft.Sql/managedInstances/databases/schemas/tables/columns",
      "properties": {
        "columnType": "bit"
      }
    }
  ]
}

Definitions

Name Description
ColumnDataType

The column data type.

DatabaseColumn

A database column resource.

DatabaseColumnListResult

A list of database columns.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

TableTemporalType

The table temporal type.

ColumnDataType

The column data type.

Value Description
image
text
uniqueidentifier
date
time
datetime2
datetimeoffset
tinyint
smallint
int
smalldatetime
real
money
datetime
float
sql_variant
ntext
bit
decimal
numeric
smallmoney
bigint
hierarchyid
geometry
geography
varbinary
varchar
binary
char
timestamp
nvarchar
nchar
xml
sysname

DatabaseColumn

A database column resource.

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.columnType

ColumnDataType

The column data type.

properties.isComputed

boolean

Whether or not the column is computed.

properties.memoryOptimized

boolean

Whether or not the column belongs to a memory optimized table.

properties.temporalType

TableTemporalType

The table temporal type.

type

string

Resource type.

DatabaseColumnListResult

A list of database columns.

Name Type Description
nextLink

string

Link to retrieve next page of results.

value

DatabaseColumn[]

Array of results.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

TableTemporalType

The table temporal type.

Value Description
NonTemporalTable
HistoryTable
SystemVersionedTemporalTable