Share via


az synapse sql-script

Manage SQL scripts in a synapse workspace.

Commands

Name Description Type Status
az synapse sql-script create

Create or update a SQL script.

Core GA
az synapse sql-script delete

Delete a SQL script.

Core GA
az synapse sql-script export

Export a SQL script.

Core GA
az synapse sql-script import

Import a SQL script.

Core GA
az synapse sql-script list

List SQL scripts in a synapse workspace.

Core GA
az synapse sql-script show

Get a SQL script.

Core GA
az synapse sql-script wait

Place the CLI in a waiting state until a condition of a sql script is met.

Core GA

az synapse sql-script create

Create or update a SQL script.

az synapse sql-script create --file
                             --name
                             --workspace-name
                             [--additional-properties]
                             [--description]
                             [--folder-name]
                             [--no-wait]
                             [--result-limit {-1, 5000}]
                             [--sql-database-name]
                             [--sql-pool-name]

Examples

Create a SQL script.

az synapse sql-script create --workspace-name testsynapseworkspace \
  --name testsqlscriptname \
  --file 'path/test.sql'

Required Parameters

--file -f

The SQL query file path.

--name -n

The SQL script name.

--workspace-name

The workspace name.

Optional Parameters

--additional-properties

The SQL script additional properties.

--description

The SQL script description.

--folder-name

The folder that this SQL script is in. If not specified, this SQL script will appear at the root level. Eg: folder/subfolder1.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--result-limit

The SQL query results limit. Default is 5000. '-1' is no limit.

Accepted values: -1, 5000
Default value: 5000
--sql-database-name

The SQL database name.

--sql-pool-name

The SQL pool name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az synapse sql-script delete

Delete a SQL script.

az synapse sql-script delete --name
                             --workspace-name
                             [--no-wait]

Examples

Delete a SQL script.

az synapse sql-script delete --workspace-name testsynapseworkspace \
  --name testsqlscriptname

Required Parameters

--name -n

The SQL script name.

--workspace-name

The workspace name.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az synapse sql-script export

Export a SQL script.

az synapse sql-script export --output-folder
                             --workspace-name
                             [--name]

Examples

Export a SQL script.

az synapse sql-script export --workspace-name testsynapseworkspace \
  --name testsqlscriptname \
  --output-folder 'path/folder'

Required Parameters

--output-folder

The SQL script export path.

--workspace-name

The workspace name.

Optional Parameters

--name -n

The SQL script name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az synapse sql-script import

Import a SQL script.

az synapse sql-script import --file
                             --name
                             --workspace-name
                             [--additional-properties]
                             [--description]
                             [--folder-name]
                             [--no-wait]
                             [--result-limit {-1, 5000}]
                             [--sql-database-name]
                             [--sql-pool-name]

Examples

Import a SQL script.

az synapse sql-script import --workspace-name testsynapseworkspace \
  --name testsqlscriptname \
  --file 'path/test.sql'

Required Parameters

--file -f

The SQL query file path.

--name -n

The SQL script name.

--workspace-name

The workspace name.

Optional Parameters

--additional-properties

The SQL script additional properties.

--description

The SQL script description.

--folder-name

The folder that this SQL script is in. If not specified, this SQL script will appear at the root level. Eg: folder/subfolder1.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--result-limit

The SQL query results limit. Default is 5000. '-1' is no limit.

Accepted values: -1, 5000
Default value: 5000
--sql-database-name

The SQL database name.

--sql-pool-name

The SQL pool name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az synapse sql-script list

List SQL scripts in a synapse workspace.

az synapse sql-script list --workspace-name

Examples

List SQL scripts.

az synapse sql-script list --workspace-name testsynapseworkspace

Required Parameters

--workspace-name

The workspace name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az synapse sql-script show

Get a SQL script.

az synapse sql-script show --name
                           --workspace-name

Examples

Get a SQL script.

az synapse sql-script show --workspace-name testsynapseworkspace \
  --name testsqlscriptname

Required Parameters

--name -n

The SQL script name.

--workspace-name

The workspace name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az synapse sql-script wait

Place the CLI in a waiting state until a condition of a sql script is met.

az synapse sql-script wait --name
                           --workspace-name
                           [--created]
                           [--custom]
                           [--deleted]
                           [--exists]
                           [--interval]
                           [--timeout]
                           [--updated]

Required Parameters

--name -n

The SQL script name.

--workspace-name

The workspace name.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--interval

Polling interval in seconds.

Default value: 30
--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.