Sql Script - Get Sql Script
Gets a sql script.
GET {endpoint}/sqlScripts/{sqlScriptName}?api-version=2020-12-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
endpoint
|
path | True |
string uri |
The workspace development endpoint, for example |
sql
|
path | True |
string |
The sql script name. |
api-version
|
query | True |
string |
The Synapse client API Version. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
If-None-Match |
string |
ETag of the sql compute entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK. |
|
Other Status Codes |
Not modified. |
|
Other Status Codes |
An error response received from the Azure Synapse service. |
Examples
SqlScripts_Get
Sample Request
GET exampleWorkspace.dev.azuresynapse.net/sqlScripts/exampleSqlScript?api-version=2020-12-01
Sample Response
Date: Sat, 16 Jun 2018 00:37:41 GMT
X-Content-Type-Options: nosniff
x-ms-ratelimit-remaining-subscription-writes: 1192
x-ms-request-id: e4c589b7-a9fe-4c28-981c-3855ec27d264
x-ms-correlation-request-id: e4c589b7-a9fe-4c28-981c-3855ec27d264
{
"id": "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.Synapse/workspaces/exampleWorkspaceName/sqlscripts/exampleSqlScript",
"name": "exampleSqlScript",
"type": "Microsoft.Synapse/workspaces/sqlscripts",
"properties": {
"description": "Covers the data transformation and LDW scenarios in one brief e2e story",
"content": {
"query": "SELECT TOP 100 * FROM example_table_name;",
"currentConnection": {
"name": "master",
"type": "SqlOnDemand"
},
"metadata": {
"language": "sql"
}
},
"type": "SqlQuery"
},
"etag": "1500504f-0000-0200-0000-5cbe090f0000"
}
Definitions
Name | Description |
---|---|
Cloud |
The object that defines the structure of an Azure Synapse error response. |
Folder |
The folder that this SQL script is in. If not specified, this SQL script will appear at the root level. |
Sql |
The connection used to execute the SQL script. |
Sql |
The type of the connection. |
Sql |
SQL script. |
Sql |
The content of the SQL script. |
Sql |
The metadata of the SQL script. |
Sql |
Sql Script resource type. |
Sql |
The type of the SQL script. |
CloudError
The object that defines the structure of an Azure Synapse error response.
Name | Type | Description |
---|---|---|
error.code |
string |
Error code. |
error.details |
Array with additional error details. |
|
error.message |
string |
Error message. |
error.target |
string |
Property name/path in request associated with error. |
Folder
The folder that this SQL script is in. If not specified, this SQL script will appear at the root level.
Name | Type | Description |
---|---|---|
name |
string |
The name of the folder that this SQL script is in. |
SqlConnection
The connection used to execute the SQL script.
Name | Type | Description |
---|---|---|
databaseName |
string |
The associated database name (supported by SQL pool v3) |
name |
string |
The identifier of the connection. |
poolName |
string |
The associated SQL pool name (supported by SQL pool v3) |
type |
The type of the connection. |
SqlConnectionType
The type of the connection.
Name | Type | Description |
---|---|---|
SqlOnDemand |
string |
|
SqlPool |
string |
SqlScript
SQL script.
Name | Type | Description |
---|---|---|
content |
The content of the SQL script. |
|
description |
string |
The description of the SQL script. |
folder |
The folder that this SQL script is in. If not specified, this SQL script will appear at the root level. |
|
type |
The type of the SQL script. |
SqlScriptContent
The content of the SQL script.
Name | Type | Description |
---|---|---|
currentConnection |
The connection used to execute the SQL script. |
|
metadata |
The metadata of the SQL script. |
|
query |
string |
SQL query to execute. |
resultLimit |
integer |
Limit of results, '-1' for no limit. |
SqlScriptMetadata
The metadata of the SQL script.
Name | Type | Description |
---|---|---|
language |
string |
The language of the SQL script. |
SqlScriptResource
Sql Script resource type.
Name | Type | Description |
---|---|---|
etag |
string |
Resource Etag. |
id |
string |
Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name |
string |
The name of the resource |
properties |
Properties of sql script. |
|
type |
string |
The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. |
SqlScriptType
The type of the SQL script.
Name | Type | Description |
---|---|---|
SqlQuery |
string |