Synapse Studio SQL scripts in Azure Synapse Analytics
Synapse Studio provides a web interface for SQL scripts where you can author SQL queries.
Begin authoring in a SQL script
To start the authoring experience in a SQL script, you can create a new SQL script through one of the following methods on the Develop pane:
Select the plus sign (+), and then select SQL script.
Right-click SQL scripts, and then select New SQL script.
Right-click SQL scripts, and then select Import. Select an existing SQL script from your local storage.
Create your SQL script
Choose a name for your SQL script by selecting the Properties button and replacing the default name assigned to the SQL script.
On the Connect to dropdown menu, select the specific dedicated SQL pool or serverless SQL pool. Or if necessary, choose the database from Use database.
Start authoring your SQL script by using the IntelliSense feature.
Run your SQL script
To run your SQL script, select the Run button. The results appear in a table by default.
Synapse Studio creates a new session for each SQL script execution. After a SQL script execution finishes, the session is automatically closed.
Temporary tables are visible only in the session where you created them. They're automatically dropped when the session closes.
Export your results
You can export the results to your local storage in various formats (including CSV, Excel, JSON, and XML) by selecting Export results and choosing the extension.
You can also visualize the SQL script results in a chart by selecting the Chart button. Then select the Chart type and Category column values. You can export the chart into a picture by selecting Save as image.
Explore data from a Parquet file
You can explore Parquet files in a storage account by using a SQL script to preview the file contents.
Use SQL tables, external tables, and views
By using a shortcut menu on the Data pane, you can select actions for resources like SQL tables, external tables, and views. Explore the available commands by right-clicking the nodes of SQL databases. The commands for New SQL script include:
- Select TOP 100 rows
- CREATE
- DROP
- DROP and CREATE
Create folders and move SQL scripts into a folder
To create a folder:
On the Develop pane, right-click SQL scripts and then select New folder.
On the pane that opens, enter the name of the new folder.
To move a SQL script into a folder:
Right-click the SQL script, and then select Move to.
On the Move to pane, choose a destination folder, and then select Move here. You can also quickly drag the SQL script and drop it into a folder.
Related content
- For more information about authoring a SQL script, see the Azure Synapse Analytics documentation.