azdata sql
Applies to:
Azure Data CLI (azdata
)
The following article provides reference for the sql commands in the azdata tool. For more information about other azdata commands, see azdata reference
Command | Description |
---|---|
azdata sql shell | The SQL CLI allows the user to interact with SQL Server and Azure SQL via T-SQL. |
azdata sql query | The SQL CLI allows the user to interact with SQL Server and Azure SQL via T-SQL. |
The SQL CLI allows the user to interact with SQL Server and Azure SQL via T-SQL.
azdata sql shell [--username -u]
[--database -d]
[--server -s]
[--integrated -e]
[--mssqlclirc]
[--row-limit]
[--less-chatty]
[--auto-vertical-output]
[--encrypt -n]
[--trust-server-certificate -c]
[--connect-timeout -l]
[--application-intent -k]
[--multi-subnet-failover -m]
[--packet-size]
[--dac-connection -a]
[--input-file -i]
[--output-file]
[--enable-sqltoolsservice-logging]
[--prompt]
Example command line to start the interactive experience.
azdata sql shell
Example command line using a provided server, user, and database
azdata sql shell --server localhost --username sa --database master
Username to connect to the database.
Database name to connect to.
SQL Server instance name or address.
Use integrated authentication on Windows.
Location of mssqlclirc config file.
Set threshold for row limit prompt. Use 0 to disable prompt.
Skip intro on startup and goodbye on exit.
Automatically switch to vertical output mode if the result is wider than the terminal width.
SQL Server uses SSL encryption for all data if the server has a certificate installed.
The channel will be encrypted while bypassing walking the certificate chain to validate trust.
Time in seconds to wait for a connection to the server before terminating request.
Declares the application workload type when connecting to a database in a SQL Server Availability Group.
If application is connecting to Always On AG on different subnets, setting this provides faster detection and connection to currently active server.
Size in bytes of the network packets used to communicate with SQL Server.
Connect to SQL Server using the dedicated administrator connection.
Specifies the file that contains a batch of SQL statements for processing.
Specifies the file that receives output from a query.
Enables diagnostic logging for the SqlToolsService.
Prompt format (Default: \d>
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Output format. Allowed values: json, jsonc, table, tsv. Default: json.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
The SQL CLI allows the user to interact with SQL Server and Azure SQL via T-SQL.
azdata sql query -q
[--database -d]
[--username -u]
[--server -s]
[--integrated -e]
Example command line to select the list of tables names.
azdata sql query --server localhost --username sa --database master -q "SELECT name FROM SYS.TABLES"
T-SQL query to execute.
Database name to connect to.
master
Username to connect to the database.
SQL Server instance name or address.
Use integrated authentication on Windows.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Output format. Allowed values: json, jsonc, table, tsv. Default: json.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
For more information about other azdata commands, see azdata reference.
For more information about how to install the azdata tool, see Install azdata.