Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✅ SQL database in Microsoft Fabric
Copilot in Fabric in the SQL database workload is an AI tool designed to simplify the management and querying of SQL databases. Copilot offers intelligent code completion, quick actions, and natural language to SQL conversion. This article explores how Copilot can enhance productivity, accuracy, and learning for database administrators, developers, and data analysts.
Features of Copilot in Fabric SQL database
Get started with Microsoft Copilot in Microsoft Fabric in the SQL database workload:
Copilot chat pane in Fabric SQL database: Use the chat pane to ask Copilot questions through natural language.
- Natural Language to SQL: Generate T-SQL code and get suggestions of questions to ask to accelerate your workflow.
- Documentation-based Q&A: Ask Copilot questions about the capabilities of Microsoft Copilot in Microsoft Fabric in the SQL database workload and it provides answers in natural language along with relevant documentations.
Copilot code completion for Copilot in Fabric SQL database: Start writing T-SQL in the SQL query editor, and Microsoft Copilot automatically generates a code suggestion to help complete your query. The Tab key accepts the code suggestion or keeps typing to ignore the suggestion. Copilot can also suggest code completions for table and column names, functions, and keywords.
Copilot Explain and Fix quick action features for Copilot in Fabric SQL database: In the ribbon of the SQL query editor, the Fix and Explain options are quick actions. Highlight a SQL query of your choice and select one of the quick action buttons to perform the selected action on your query.
- Fix: Copilot can fix errors in your code as error messages arise. Error scenarios include incorrect/unsupported T-SQL code, wrong spellings, and more. Copilot also provides comments that explain the changes and suggest SQL best practices.
- Explain: Copilot can provide natural language explanations of your SQL query and database schema in comments format.
Enable Copilot in Fabric SQL database
To enable Microsoft Copilot in Microsoft Fabric in the SQL database workload, follow the steps below.
- Your administrator needs to enable the tenant switch before you start using Copilot. For more information, see Copilot tenant settings.
- Your F2 or P1 capacity needs to be in one of the regions listed in Fabric region availability.
- If your tenant or capacity is outside the US or France, Copilot is disabled by default unless your Fabric tenant admin enables the Data sent to Azure OpenAI can be processed outside your tenant's geographic region, compliance boundary, or national cloud instance tenant setting in the Fabric Admin portal.
- Copilot in Microsoft Fabric isn't supported on trial SKUs. Only paid SKUs (F2 or higher, or P1 or higher) are supported at this time.
- For more information, see Overview of Copilot in Fabric and Power BI.
Best practices for using Copilot in Fabric SQL database
Here are some tips for effectively maximizing productivity with Copilot:
- Start with a clear and concise description of the specific information you seek when crafting prompts.
- Natural language to SQL depends on expressive table and column names. If your table and columns aren't expressive and descriptive, Copilot might be unable to construct a meaningful query.
- Use natural language that applies to your table and view your database's names, column names, primary keys, and foreign keys. This context helps Copilot generate accurate queries. Specify what columns you wish to see, aggregations, and any filtering criteria as explicitly as possible. Given your schema context, Copilot should be able to correct typos or understand the context.
- When using code completions, leave a comment at the top of the query with
--
to help guide the Copilot with context about the query you're trying to write. - Avoid ambiguous or overly complex language in your prompts. Simplify the question while maintaining its clarity. This editing ensures that Copilot can translate it into a meaningful T-SQL query that retrieves the desired data.
Example prompts
The following example prompts are clear, specific, and tailored to the properties of your schema and database, making it easier for Copilot to generate accurate T-SQL queries.
- What are the top-selling products by quantity?
- Count all the products grouped by category
- Show all sales transactions that occurred on [a specific date]
Note
AI powers Copilot, so surprises and mistakes are possible.
Responsible AI use of Copilot
To view Microsoft's guidelines for responsible AI in SQL database, see Privacy, security, and responsible use of Copilot for SQL database in Microsoft Fabric (preview).
Microsoft is committed to ensuring that our AI systems are guided by our AI principles and Responsible AI Standard. These principles include empowering our customers to use these systems effectively and in line with their intended uses. Our approach to responsible AI is continually evolving to proactively address emerging issues.
Limitations
Here are the current limitations of Microsoft Copilot in Microsoft Fabric in the SQL database workload:
- Copilot can't change existing SQL queries in the SQL query editor. For example, if you ask Copilot chat pane to edit a specific part of an existing query, it doesn't work. However, Copilot understands previous inputs in the chat pane, allowing users to iterate queries previously generated by Copilot before they're inserted.
- Copilot might produce inaccurate results when the intent is to evaluate data. Copilot only has access to the database schema; none of the data is inside.
- Copilot responses can include inaccurate or low-quality content, so review outputs before using them in your work.
- People who can meaningfully evaluate the content's accuracy and appropriateness should review the outputs.
- Microsoft Copilot in Microsoft Fabric in the SQL database workload isn't currently available if Private Link is enabled and Public Access is turned off in the tenant setting.