Applies to: â SQL database in Microsoft Fabric
This article describes how to use the SQL query editor in the Microsoft Fabric portal.
The SQL query editor provides support for IntelliSense, code completion, syntax highlighting, client-side parsing, and validation. You can run Data Definition Language (DDL), Data Manipulation Language (DML), and Data Control Language (DCL) statements.
You can also query the data in your database with multiple tools with a SQL connection string.
SQL query editor in the Fabric portalThe SQL query editor provides a text editor to write queries using T-SQL.
To access the built-in SQL query editor, create a new query using the New SQL query button. If you select the dropdown list, you can easily create T-SQL objects with code templates that populate in your SQL query window.
As you work on your SQL query, the queries are automatically saved every few seconds. A "saving" indicator appears in your query tab to indicate that your query is being saved.
View query resultsOnce you've written the T-SQL query, select Run to execute the query. Two tabs contain the query result set and information.
You can save your query as a view using the Save as view button.
Select the schema name that you have access to create views, provide name of view and verify the SQL statement before confirming creating view. When view is successfully created, it appears in the Explorer.
Download as Excel/JSON/CSV
You can download your result set as a Microsoft Excel (.xlsx) file using the download button. You can also download JSON or CSV versions of the result set data, as well as copy/paste the result set to your clipboard.
Multiple result sets
When you run multiple queries and those return multiple results, you can select results dropdown list to see individual results.
Copilot
The SQL query editor is powered by Copilot for SQL database. It is designed to accelerate database development by leveraging generative AI to simplify and automate database management and improving the efficiency of writing T-SQL queries. Copilot is contextualized to your database's schema and can generate answers catered for you.
Copilot for SQL database offers a variety of features. For more information, visit Features of Copilot for SQL database in Microsoft Fabric.
Before your business can start using Copilot for SQL database, you need to enable Copilot.
Keyboard shortcutsKeyboard shortcuts provide a quick way to navigate and allow users to work more efficiently in SQL query editor. The table in this article lists all the shortcuts available in SQL query editor in the Microsoft Fabric portal:
Function Windows Shortcut macOS Shortcut New SQL queryCtrl + J
Cmd + J
Close current tab Ctrl + Shift + F4
Cmd + Shift + F4
Run SQL Script Ctrl + Enter, Shift +Enter
Cmd + Enter, Shift +Enter
Search string Ctrl + F
Cmd + F
Replace string Ctrl + H
Cmd + H
Undo Ctrl + Z
Cmd + Z
Redo Ctrl + Y
Cmd + Y
Go one word left Ctrl + Left arrow key
Cmd + Left arrow key
Go one word right Ctrl + Right arrow key
Cmd + Right arrow key
Indent increase Tab
Tab
Indent decrease Shift + Tab
Shift + Tab
Move cursor up â
â
Move cursor down â
â
Select All Ctrl + A
Cmd + A
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4