sql_script
Creates, updates, deletes, gets or lists a sql_script resource.
Overview
| Name | sql_script |
| Type | Resource |
| Id | azure.synapse_artifacts.sql_script |
Fields
The following fields are returned by SELECT queries:
- get_sql_script
- get_sql_scripts_by_workspace
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long |
name | string | The name of the resource. Required. |
| object | Unmatched properties from the message are deserialized to this collection. |
content | object | The content of the SQL script. Required. |
description | string | The description of the SQL script. |
etag | string | Resource Etag. |
folder | object | The folder that this SQL script is in. If not specified, this SQL script will appear at the root level. |
type | string | The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long |
name | string | The name of the resource. Required. |
| object | Unmatched properties from the message are deserialized to this collection. |
content | object | The content of the SQL script. Required. |
description | string | The description of the SQL script. |
etag | string | Resource Etag. |
folder | object | The folder that this SQL script is in. If not specified, this SQL script will appear at the root level. |
type | string | The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_sql_script | select | sql_script_name, endpoint | If-None-Match | Gets a sql script. |
get_sql_scripts_by_workspace | select | endpoint | Lists sql scripts. | |
create_or_update_sql_script | insert | sql_script_name, endpoint, name, properties | If-Match | Creates or updates a Sql Script. |
create_or_update_sql_script | replace | sql_script_name, endpoint, name, properties | If-Match | Creates or updates a Sql Script. |
delete_sql_script | delete | sql_script_name, endpoint | Deletes a Sql Script. | |
rename_sql_script | exec | sql_script_name, endpoint | Renames a sqlScript. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
endpoint | string | The service endpoint host (no scheme). (default: ) |
sql_script_name | string | The sql script name. Required. |
If-Match | string | ETag of the SQL script entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. |
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. Default value is None. |
SELECT examples
- get_sql_script
- get_sql_scripts_by_workspace
Gets a sql script.
SELECT
id,
name,
,
content,
description,
etag,
folder,
type
FROM azure.synapse_artifacts.sql_script
WHERE sql_script_name = '{{ sql_script_name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND If-None-Match = '{{ If-None-Match }}'
;
Lists sql scripts.
SELECT
id,
name,
,
content,
description,
etag,
folder,
type
FROM azure.synapse_artifacts.sql_script
WHERE endpoint = '{{ endpoint }}' -- required
;
INSERT examples
- create_or_update_sql_script
- Manifest
Creates or updates a Sql Script.
INSERT INTO azure.synapse_artifacts.sql_script (
name,
properties,
sql_script_name,
endpoint,
If-Match
)
SELECT
'{{ name }}' /* required */,
'{{ properties }}' /* required */,
'{{ sql_script_name }}',
'{{ endpoint }}',
'{{ If-Match }}'
RETURNING
id,
name,
etag,
properties,
type
;
# Description fields are for documentation purposes
- name: sql_script
props:
- name: sql_script_name
value: "{{ sql_script_name }}"
description: Required parameter for the sql_script resource.
- name: endpoint
value: "{{ endpoint }}"
description: Required parameter for the sql_script resource.
- name: name
value: "{{ name }}"
description: |
The name of the resource. Required.
- name: properties
description: |
Properties of sql script. Required.
value:
: "{{ }}"
description: "{{ description }}"
type: "{{ type }}"
content:
: "{{ }}"
query: "{{ query }}"
currentConnection:
: "{{ }}"
type: "{{ type }}"
name: "{{ name }}"
poolName: "{{ poolName }}"
databaseName: "{{ databaseName }}"
resultLimit: {{ resultLimit }}
metadata:
: "{{ }}"
language: "{{ language }}"
folder:
name: "{{ name }}"
- name: If-Match
value: "{{ If-Match }}"
description: ETag of the SQL script entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None.
description: ETag of the SQL script entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None.
REPLACE examples
- create_or_update_sql_script
Creates or updates a Sql Script.
REPLACE azure.synapse_artifacts.sql_script
SET
name = '{{ name }}',
properties = '{{ properties }}'
WHERE
sql_script_name = '{{ sql_script_name }}' --required
AND endpoint = '{{ endpoint }}' --required
AND name = '{{ name }}' --required
AND properties = '{{ properties }}' --required
AND If-Match = '{{ If-Match}}'
RETURNING
id,
name,
etag,
properties,
type;
DELETE examples
- delete_sql_script
Deletes a Sql Script.
DELETE FROM azure.synapse_artifacts.sql_script
WHERE sql_script_name = '{{ sql_script_name }}' --required
AND endpoint = '{{ endpoint }}' --required
;
Lifecycle Methods
- rename_sql_script
Renames a sqlScript.
EXEC azure.synapse_artifacts.sql_script.rename_sql_script
@sql_script_name='{{ sql_script_name }}' --required,
@endpoint='{{ endpoint }}' --required
;