Tag: GitHub Copilot

Create and configure GitHub Copilot instruction files (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement SQL solutions by using AI-assisted tools
      --> Create and configure GitHub Copilot instruction files


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

GitHub Copilot is an AI-powered coding assistant that generates code, explains existing code, creates documentation, and assists with debugging. While Copilot is powerful out of the box, organizations often need the AI to follow company-specific standards instead of producing generic code.

GitHub Copilot instruction files provide persistent guidance to Copilot. Rather than repeatedly telling Copilot the same preferences during every chat session, developers can store instructions in version-controlled files inside the repository. They help ensure that AI-generated code follows an organization’s coding standards, security requirements, architectural patterns, naming conventions, and SQL development best practices. Candidates should understand not only how to create these files, but also how they influence Copilot’s responses.

Instruction files improve:

  • Consistency
  • Security
  • Coding standards
  • SQL development practices
  • Documentation quality
  • Team collaboration
  • AI response quality

For the DP-800 exam, understand:

  • What instruction files are
  • Where they are stored
  • What types of instructions they contain
  • How they affect Copilot responses
  • Best practices for SQL development

Why Use Instruction Files?

Without instruction files:

Developer:
Create a stored procedure.
Copilot:
Creates one using SELECT * and no error handling.

Next time:

Developer:
Remember to avoid SELECT *
Use TRY...CATCH
Use PascalCase
Include comments
Use parameters

The developer must continually repeat instructions.

With instruction files:

Repository contains instructions.
Copilot automatically follows them.

Every developer receives consistent AI assistance.


What Are GitHub Copilot Instruction Files?

Instruction files are Markdown files that contain natural-language guidance for Copilot.

They describe:

  • Coding style
  • Naming conventions
  • Architecture
  • Security practices
  • SQL standards
  • Documentation requirements
  • Testing expectations

Instead of writing prompts repeatedly, the repository permanently stores the instructions.


Benefits

Instruction files provide:

Consistency

Every developer receives similar AI suggestions.


Faster Development

Less prompt engineering.

Developers spend less time explaining requirements.


Higher Code Quality

Instructions encourage:

  • Proper formatting
  • Secure coding
  • Error handling
  • Documentation

Better Security

Organizations can require Copilot to:

  • Parameterize SQL
  • Avoid dynamic SQL
  • Validate input
  • Follow least privilege

Team Standards

New developers immediately receive guidance that matches experienced developers.


Repository-Level Instructions

Instruction files are stored with the project.

Example:

Repository
├── .github
│ copilot-instructions.md
├── Database
├── Procedures
├── Functions
└── Tables

The instructions become part of source control.

Everyone cloning the repository receives them.


What Can Instruction Files Contain?

Common guidance includes:

Coding conventions

Example

Use PascalCase for object names.
Avoid abbreviations.
Use descriptive variable names.

SQL Standards

Example

Never use SELECT *
Always qualify object names.
Always use schema prefixes.
Prefer explicit column lists.

Error Handling

Example

Always wrap stored procedures inside TRY...CATCH.
Log errors before rethrowing.

Documentation

Example

Document all procedures.
Include parameter descriptions.
Explain business rules.

Performance

Example

Avoid cursors.
Prefer set-based operations.
Use appropriate indexing.
Avoid unnecessary temp tables.

Security

Example

Always use parameterized queries.
Never concatenate SQL strings.
Validate inputs.
Follow least privilege.

SQL Example

Instruction:

Use schema dbo.
Always include SET NOCOUNT ON.
Use TRY...CATCH.
Document parameters.
Never use SELECT *.

Prompt:

Create a procedure to retrieve customers.

Generated procedure might include:

CREATE PROCEDURE dbo.GetCustomers
(
@Country NVARCHAR(50)
)
AS
BEGIN
SET NOCOUNT ON;
BEGIN TRY
SELECT
CustomerID,
CustomerName,
Country
FROM dbo.Customers
WHERE Country=@Country;
END TRY
BEGIN CATCH
THROW;
END CATCH
END;

The instructions influence the generated output.


SQL Development Standards Commonly Included

Organizations commonly include instructions such as:

  • Use schema-qualified names
  • Use explicit column lists
  • Avoid SELECT *
  • Use transactions appropriately
  • Always parameterize SQL
  • Avoid SQL injection
  • Use TRY…CATCH
  • Return meaningful errors
  • Comment complex logic
  • Format SQL consistently

Database Naming Standards

Instruction files frequently define naming conventions.

Example

Tables

SalesOrders
Customers
Invoices

Procedures

usp_GetOrders
usp_InsertCustomer

Views

vwCustomerSales

Functions

fnCalculateTax

Documentation Standards

Instructions often require:

Every procedure includes:

  • Purpose
  • Parameters
  • Return values
  • Modification history

Example

Purpose:
Returns active customers.
Parameters:
@Country
Returns:
Customer list.

Security Guidance

Instruction files often include security rules.

Examples:

Do not:

SELECT *

Do not:

EXEC(@SQL)

Do:

sp_executesql

Do:

Parameterized queries

Require:

  • Least privilege
  • Input validation
  • Data masking awareness
  • Sensitive data handling

Performance Guidance

Example instructions:

Prefer:

  • Set-based operations
  • Appropriate indexes
  • EXISTS
  • Window functions

Avoid:

  • Nested cursors
  • RBAR processing
  • Unnecessary DISTINCT
  • Scalar UDFs inside large queries

AI Prompt Consistency

Instead of writing:

Generate a procedure.
Use TRY...CATCH.
No SELECT *
Include comments.
Use PascalCase.

Simply write:

Generate a procedure.

Copilot automatically follows repository guidance.


Version Control Benefits

Instruction files are version controlled.

Benefits include:

  • Change history
  • Code reviews
  • Branch support
  • Rollback capability
  • Team collaboration

Team Collaboration

Instruction files help ensure:

Developer A

Developer B

Developer C

Copilot

Consistent code

Everyone receives similar recommendations.


Best Practices

Microsoft recommends:

  • Keep instructions concise.
  • Focus on project-specific guidance.
  • Store instruction files with the repository.
  • Update instructions as standards evolve.
  • Use clear, natural language.
  • Include coding, security, testing, and documentation expectations.
  • Review instruction files during pull requests.
  • Avoid contradictory instructions.
  • Combine repository instructions with task-specific prompts when necessary.
  • Regularly validate that generated code still meets organizational standards.

Common Mistakes

Avoid:

❌ Extremely long instruction files

❌ Conflicting rules

❌ Outdated architecture guidance

❌ Security rules that contradict current policy

❌ Generic instructions that provide little value

❌ Forgetting to update instructions after framework changes

❌ Assuming Copilot always follows instructions perfectly without human review


DP-800 Exam Tips

Candidates should know:

  • Instruction files provide persistent repository guidance.
  • They improve consistency across AI-generated code.
  • They are stored with the project and version controlled.
  • They can define coding standards, SQL conventions, security requirements, testing expectations, and documentation guidelines.
  • They reduce repetitive prompting.
  • They complement, rather than replace, user prompts.
  • Developers remain responsible for validating all AI-generated code.
  • Well-written instruction files improve code quality and team productivity.

Summary

GitHub Copilot instruction files are an important mechanism for guiding AI-generated code within a project. By defining repository-specific coding standards, security practices, documentation requirements, and SQL development conventions, organizations can improve consistency, reduce repetitive prompting, and ensure AI-generated code better aligns with business requirements. However, instruction files do not eliminate the need for developer review. AI-generated code should always be validated for correctness, performance, maintainability, and security before deployment.


Practice Exam Questions

Question 1

A development team wants GitHub Copilot to always generate SQL stored procedures that include SET NOCOUNT ON, TRY...CATCH blocks, and schema-qualified object names. What is the best way to accomplish this?

A. Add these requirements to a GitHub Copilot instruction file stored in the repository.

B. Modify SQL Server configuration settings.

C. Configure database compatibility level.

D. Enable Query Store.

Answer: A

Explanation: Repository instruction files provide persistent guidance that GitHub Copilot automatically considers when generating code.


Question 2

What is the primary purpose of a GitHub Copilot instruction file?

A. Improve SQL Server query performance.

B. Define repository-specific guidance that influences AI-generated code.

C. Store database credentials.

D. Configure Azure SQL firewall rules.

Answer: B

Explanation: Instruction files define coding conventions, security requirements, architectural guidance, and other project-specific expectations for Copilot.


Question 3

Which instruction would most directly reduce the likelihood of SQL injection vulnerabilities in AI-generated code?

A. Use uppercase SQL keywords.

B. Always include comments.

C. Always use parameterized queries and avoid dynamic SQL string concatenation.

D. Use table aliases.

Answer: C

Explanation: Parameterized queries are a primary defense against SQL injection attacks.


Question 4

A team updates its SQL naming conventions. What is the best way to ensure GitHub Copilot follows the new standards for all developers?

A. Send an email describing the new conventions.

B. Create a shared prompt document.

C. Ask every developer to memorize the standards.

D. Update the repository’s Copilot instruction file and commit the changes.

Answer: D

Explanation: Version-controlled instruction files distribute updated guidance to everyone working with the repository.


Question 5

Which guidance is most appropriate for inclusion in a GitHub Copilot instruction file?

A. Temporary debugging notes for one developer.

B. Personal keyboard shortcuts.

C. Repository-wide SQL coding standards and documentation requirements.

D. SQL Server service account passwords.

Answer: C

Explanation: Instruction files should contain reusable project guidance, never personal settings or sensitive information.


Question 6

Why are GitHub Copilot instruction files commonly stored in source control?

A. To improve SQL Server indexing.

B. To enable versioning, collaboration, and consistent AI guidance.

C. To reduce database storage.

D. To encrypt SQL scripts.

Answer: B

Explanation: Source control ensures instruction changes are tracked, reviewed, and shared across the team.


Question 7

Which statement about GitHub Copilot instruction files is correct?

A. They eliminate the need to review AI-generated code.

B. They guarantee every generated query is optimized.

C. They replace database security policies.

D. They supplement prompts by providing persistent project-specific guidance.

Answer: D

Explanation: Instruction files enhance Copilot responses but do not replace human review or additional task-specific prompting.


Question 8

A database team wants Copilot to avoid generating SELECT * statements. Where should this requirement be documented?

A. SQL Server Agent.

B. Azure Key Vault.

C. GitHub Copilot instruction file.

D. SQL Profiler.

Answer: C

Explanation: Coding conventions such as avoiding SELECT * are ideal candidates for repository instruction files.


Question 9

Which practice improves the long-term usefulness of GitHub Copilot instruction files?

A. Adding every possible coding preference.

B. Keeping instructions concise, current, and focused on project standards.

C. Storing passwords for easier AI access.

D. Avoiding updates after the initial creation.

Answer: B

Explanation: Effective instruction files are clear, maintainable, and updated as project standards evolve.


Question 10

A developer receives SQL code from GitHub Copilot that follows all repository instruction files. What should the developer do before committing the code?

A. Commit it immediately because instruction files guarantee correctness.

B. Only verify formatting.

C. Disable Copilot.

D. Review the code for correctness, performance, security, and compliance with business requirements.

Answer: D

Explanation: AI-generated code should always undergo human review, testing, and validation, even when instruction files are used.


Go to the DP-800 Exam Prep Hub main page

Configure model and Model Context Protocol (MCP) tool options in a GitHub Copilot or Copilot in Fabric chat session – Part 3 (DP-800 Exam Prep)

Part 3 – End-to-End Development Scenarios and Practice Exam Questions


This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement SQL solutions by using AI-assisted tools
      --> Configure model and Model Context Protocol (MCP) tool options in a GitHub Copilot or Copilot in Fabric chat session


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

Candidates should understand how AI models and MCP-enabled tools work together throughout the SQL development lifecycle—from planning and coding to testing, deployment, and optimization.


End-to-End SQL Development Workflow

The following illustrates a typical workflow for AI-assisted SQL development.

Requirements
Developer Prompt
GitHub Copilot /
Copilot in Fabric
Selected AI Model
(Optional)
Invoke MCP Tools
Retrieve Context
• Database schema
• Existing procedures
• Documentation
• APIs
• GitHub repository
Generate SQL
Developer Review
Testing
Deployment

The AI assists throughout the workflow, but the developer remains responsible for reviewing, validating, and approving the generated solution.


Scenario 1 – Designing a New Database Table

A developer receives the following requirement:

Create a Customer table with auditing columns, primary key, email uniqueness, and indexes.

Prompt

Design a Customer table for Azure SQL Database. Include an identity primary key, audit columns, email uniqueness, and indexes for common lookup operations.

AI Response

The AI generates:

  • CREATE TABLE statement
  • PRIMARY KEY constraint
  • UNIQUE constraint
  • DEFAULT values
  • indexes
  • documentation

The developer reviews:

  • naming conventions
  • data types
  • indexing strategy
  • normalization
  • storage requirements

Scenario 2 – Creating Stored Procedures

The database already contains 150 tables.

Rather than manually examining the schema, GitHub Copilot uses an approved MCP server.

Developer prompt:

Create a stored procedure that returns all active customers with orders placed within the last 90 days.

Possible MCP interactions:

  • Read Customers table
  • Read Orders table
  • Discover foreign keys
  • Retrieve indexes

The AI produces SQL using the actual schema instead of making assumptions.


Scenario 3 – Query Optimization

A report currently takes 22 seconds.

Developer prompt:

Optimize this query for Azure SQL Database.

The reasoning model determines additional information is needed.

Using MCP:

  • retrieves execution plan
  • retrieves index information
  • retrieves statistics
  • retrieves row counts

The response includes:

  • rewritten SQL
  • missing indexes
  • parameter sniffing observations
  • SARGability improvements
  • estimated performance gains

Scenario 4 – Fabric Warehouse Development

A Fabric Warehouse contains several sales tables.

Developer asks:

Explain the warehouse schema and suggest a star schema optimization.

Copilot may retrieve:

  • warehouse metadata
  • table relationships
  • documentation
  • semantic model information

The AI can recommend:

  • dimension tables
  • fact tables
  • surrogate keys
  • partitioning
  • indexing
  • warehouse best practices

Scenario 5 – Documentation Generation

Developer prompt:

Document this database.

The AI generates:

  • table descriptions
  • column summaries
  • relationship explanations
  • stored procedure documentation
  • index summaries
  • security notes

This significantly reduces documentation effort.


Scenario 6 – Legacy SQL Refactoring

A SQL Server database contains code written fifteen years ago.

Developer prompt:

Modernize this procedure using current T-SQL best practices.

The AI may recommend:

  • TRY…CATCH
  • THROW
  • CTEs
  • window functions
  • JSON functions
  • simplified joins
  • improved naming
  • reduced duplication

Scenario 7 – Code Review

Developer prompt:

Review this stored procedure.

The AI evaluates:

  • security
  • SQL injection risks
  • indexing
  • readability
  • performance
  • maintainability

Rather than replacing human review, AI serves as an intelligent reviewer.


Scenario 8 – Database Migration

An organization is migrating SQL Server databases to Azure SQL Database.

Developer prompt:

Identify compatibility issues.

The AI reviews:

  • deprecated features
  • unsupported syntax
  • compatibility level
  • indexing recommendations
  • Azure SQL best practices

Scenario 9 – Troubleshooting Errors

A deployment fails.

Developer prompt:

Explain this SQL error.

The AI:

  • interprets error messages
  • explains root causes
  • recommends fixes
  • suggests troubleshooting steps

Scenario 10 – Learning Existing Code

A new developer joins the team.

Developer prompt:

Explain this stored procedure.

The AI produces:

  • high-level summary
  • business logic
  • table relationships
  • parameter explanations
  • execution flow

This accelerates onboarding.


Choosing the Appropriate Model

Development TaskPreferred Model
Generate CRUD statementsFast model
Explain SQL syntaxBalanced model
Create stored proceduresBalanced model
Optimize execution plansReasoning model
Review securityReasoning model
Database architectureReasoning model
DocumentationFast/Balanced model
RefactoringBalanced model
Code reviewReasoning model
TroubleshootingReasoning model

Choosing MCP Tools

Not every prompt requires MCP.

Use MCP when the AI needs:

  • live database metadata
  • repository contents
  • API specifications
  • execution plans
  • documentation
  • schema information

Simple questions such as

What is a clustered index?

generally do not require MCP.

Questions like

Show indexes on my Sales table.

typically do.


Common Development Mistakes

Trusting AI Without Validation

Always review generated SQL.


Using Production Data

Avoid exposing confidential production data unnecessarily.


Ignoring Security

Never assume generated permissions are correct.


Using the Wrong Model

Simple code generation does not always require a reasoning model.


Excessive Permissions

Only enable MCP servers with appropriate permissions.


Skipping Testing

Every generated SQL statement should be:

  • reviewed
  • tested
  • validated

Best Practices

  • Write detailed prompts.
  • Specify Azure SQL, SQL Server, or Fabric Warehouse when applicable.
  • Include schema information.
  • Use reasoning models for optimization tasks.
  • Use MCP only when external context is beneficial.
  • Enable only trusted MCP servers.
  • Follow least privilege.
  • Review generated SQL before execution.
  • Validate performance with execution plans.
  • Keep human oversight throughout the development lifecycle.

DP-800 Exam Tips

Candidates should remember:

  • AI models generate responses.
  • MCP connects AI to external systems.
  • Tools perform actions.
  • Resources provide information.
  • Prompts standardize interactions.
  • Authentication determines identity.
  • Authorization determines permissions.
  • AI operates within the user’s security context.
  • Developers remain responsible for validating all AI-generated SQL.

Practice Exam Questions

Question 1

A developer wants GitHub Copilot to recommend missing indexes based on the actual structure of an Azure SQL Database instead of making assumptions.

What should the developer configure?

A. A larger context window only

B. An MCP server that can expose database metadata and indexing tools

C. A faster AI model

D. A local SQL script containing only CREATE TABLE statements

Answer: B

Explanation:

An MCP server enables GitHub Copilot to access live database metadata, including tables, indexes, and statistics. This allows recommendations based on the actual database rather than inferred information. Increasing the context window or switching to a faster model alone does not provide access to external database metadata.


Question 2

A developer needs AI assistance to analyze an execution plan for a query that runs for several minutes.

Which model type is generally the best choice?

A. Fast code-completion model

B. Lightweight autocomplete model

C. Reasoning-focused model

D. Documentation generation model

Answer: C

Explanation:

Execution plan analysis requires complex reasoning and performance optimization capabilities. Reasoning-focused models are designed to analyze execution strategies, identify bottlenecks, and recommend indexing or query improvements.


Question 3

Which MCP component performs operations such as retrieving index information or executing an approved query?

A. Resource

B. Prompt

C. Client

D. Tool

Answer: D

Explanation:

Tools perform actions. Resources provide information, prompts are reusable instructions, and clients host the AI conversation. Retrieving index information or executing approved operations is performed through tools.


Question 4

A developer asks Copilot:

Explain what this stored procedure does.

No external information is required.

What is the most likely outcome?

A. Copilot automatically invokes every available MCP server.

B. Copilot requires administrator approval.

C. Copilot cannot answer without MCP.

D. Copilot answers using the supplied SQL and its language model.

Answer: D

Explanation:

If the prompt includes all necessary information, the AI can respond using its language model without accessing external tools. MCP is used only when additional external context is needed.


Question 5

Why should organizations implement the principle of least privilege for MCP servers?

A. To increase response speed

B. To reduce the number of AI prompts

C. To limit access to only the resources required

D. To improve SQL syntax generation

Answer: C

Explanation:

Least privilege reduces security risks by ensuring that AI assistants and users have access only to the resources necessary to perform their tasks.


Question 6

Which statement best describes the relationship between an AI model and MCP?

A. MCP replaces the language model.

B. MCP generates SQL while the model manages security.

C. The language model generates responses, while MCP enables access to external tools and resources.

D. MCP is another name for GitHub Copilot Chat.

Answer: C

Explanation:

The language model performs reasoning and response generation. MCP provides standardized access to external systems, tools, and resources that supply additional context.


Question 7

A developer wants Copilot to use repository documentation, API specifications, and database schemas when generating SQL.

What feature provides this capability?

A. Larger prompt length

B. Database compatibility level

C. MCP-enabled resources

D. SQL IntelliSense

Answer: C

Explanation:

MCP resources allow AI assistants to access external information such as documentation, schemas, and specifications, improving the relevance and accuracy of generated responses.


Question 8

After AI generates a stored procedure, what should happen next?

A. Deploy directly to production.

B. Trust the AI because it selected a reasoning model.

C. Execute immediately without testing.

D. Review, validate, test, and approve the code before deployment.

Answer: D

Explanation:

AI-generated code should always undergo code review, testing, validation, and approval before being deployed to production.


Question 9

Which scenario is most likely to benefit from an MCP server?

A. Explaining the syntax of a SELECT statement

B. Defining a PRIMARY KEY

C. Retrieving the latest schema and execution statistics from a production database

D. Explaining SQL keywords

Answer: C

Explanation:

Accessing current schemas and execution statistics requires live information from an external system, making MCP the appropriate solution.


Question 10

Why might a developer choose a balanced AI model instead of a fast model?

A. Balanced models are designed to provide stronger reasoning while maintaining good response speed.

B. Balanced models eliminate the need for testing.

C. Balanced models automatically execute SQL.

D. Balanced models replace MCP servers.

Answer: A

Explanation:

Balanced models provide a compromise between speed and reasoning quality, making them well suited for tasks such as stored procedure development, code explanation, and general SQL assistance. They do not replace testing, execute SQL automatically, or substitute for MCP functionality.


Final DP-800 Summary

For this objective, remember these core concepts:

  • AI models determine how responses are generated (speed, reasoning, and coding quality).
  • MCP determines what additional information or actions the AI can access by connecting to external tools and resources.
  • Tools execute approved operations, while resources provide contextual information.
  • Authentication identifies the user, and authorization limits what the AI can access on that user’s behalf.
  • Developers remain responsible for validating, testing, securing, and approving all AI-generated SQL before deployment.

These concepts are foundational to the DP-800 exam and reflect Microsoft’s direction toward secure, AI-assisted database development.


Go to the DP-800 Exam Prep Hub main page

Configure model and Model Context Protocol (MCP) tool options in a GitHub Copilot or Copilot in Fabric chat session – Part 2 (DP-800 Exam Prep)

Part 2 – Configuring Model Context Protocol (MCP) Tool Options


This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement SQL solutions by using AI-assisted tools
      --> Configure model and Model Context Protocol (MCP) tool options in a GitHub Copilot or Copilot in Fabric chat session


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

The DP-800 exam expects candidates to understand how modern AI assistants can securely interact with external tools and enterprise systems through the Model Context Protocol (MCP). Rather than being limited to answering questions from their built-in knowledge, AI assistants can use MCP to retrieve live information, interact with databases, execute approved operations, and integrate with enterprise development workflows.

Understanding MCP is becoming increasingly important because Microsoft is integrating MCP support across GitHub Copilot, Azure services, Microsoft Fabric, and other AI-powered development experiences.


Learning Objectives

After studying this article, you should be able to:

  • Explain the purpose of Model Context Protocol (MCP)
  • Understand the components of an MCP architecture
  • Differentiate between models and tools
  • Explain MCP servers, tools, resources, and prompts
  • Configure MCP tool usage within GitHub Copilot
  • Understand how Copilot in Fabric uses MCP-enabled tools
  • Recognize security implications of MCP
  • Apply governance best practices
  • Identify common DP-800 exam scenarios involving MCP

What Is Model Context Protocol (MCP)?

Model Context Protocol (MCP) is an open protocol that enables AI assistants to securely connect to external tools, applications, services, databases, and other data sources using a standardized interface.

Before MCP, AI assistants were generally limited to:

  • their training data
  • information provided in prompts
  • uploaded files
  • conversation history

With MCP, an AI assistant can also interact with external systems in real time.

For example, instead of merely explaining how to query a SQL database, an MCP-enabled assistant can:

  • inspect a database schema
  • retrieve table metadata
  • read documentation
  • query approved data sources
  • access REST APIs
  • invoke external business services

This allows AI to generate responses based on current information rather than relying solely on previously learned knowledge.


Why MCP Exists

Organizations typically use dozens or hundreds of systems, such as:

  • Azure SQL Database
  • SQL Server
  • Microsoft Fabric
  • Azure Storage
  • Azure AI Search
  • GitHub repositories
  • SharePoint
  • Microsoft Learn documentation
  • Internal APIs
  • CRM systems
  • ERP systems
  • Ticketing systems

Without MCP, each AI assistant would require custom integrations for every external system.

MCP standardizes these integrations so that AI clients can communicate with many different services using a common protocol.


High-Level MCP Architecture

A simplified architecture looks like this:

Developer
GitHub Copilot Chat
or
Copilot in Fabric
Large Language Model
Model Context Protocol
MCP Server
External Resources
• SQL Database
• Azure SQL
• REST APIs
• GitHub
• Fabric
• Documentation
• Azure AI Search

The AI model determines what information it needs, while MCP provides the standardized mechanism for retrieving that information or invoking approved tools.


Core MCP Components

Model Context Protocol consists of several key building blocks.

These include:

  • Clients
  • Servers
  • Tools
  • Resources
  • Prompts

Each plays a specific role in the overall architecture.


MCP Client

The client is the application through which the user interacts with AI.

Examples include:

  • GitHub Copilot Chat
  • Copilot in Microsoft Fabric
  • Visual Studio Code
  • Visual Studio
  • Other MCP-compatible AI clients

The client sends prompts to the language model and coordinates interactions with MCP servers when external information is required.


MCP Server

The MCP server exposes capabilities that AI assistants can use.

Rather than connecting directly to every application, the AI communicates with an MCP server that provides standardized access to approved resources and operations.

Examples include servers that expose:

  • SQL databases
  • Azure SQL Database
  • GitHub repositories
  • Documentation
  • File systems
  • REST APIs
  • Internal enterprise applications

The MCP server determines which capabilities are available and enforces any configured permissions or policies.


MCP Tools

A tool represents an action that the AI can request.

Unlike resources, which provide information, tools perform operations.

Examples include:

  • Execute SQL
  • Search a database schema
  • Create a pull request
  • Retrieve execution plans
  • Query Azure AI Search
  • Generate documentation
  • Run a deployment pipeline
  • Validate a SQL script

Tools typically accept parameters, perform an action, and return structured results to the AI model.

Example

Suppose a developer asks:

Show me the indexes on the Sales.Orders table.

Rather than guessing, the AI could invoke an MCP tool that queries the database metadata and returns the actual index definitions.


MCP Resources

Resources represent information that the AI can read.

Examples include:

  • SQL schemas
  • Database documentation
  • Markdown files
  • JSON configuration files
  • API specifications
  • Technical documentation
  • Data dictionaries
  • Knowledge bases

Resources provide context that helps the model generate more accurate responses.

Unlike tools, resources generally do not modify data.


MCP Prompts

Prompts are reusable templates or predefined instructions that help standardize interactions with AI.

An organization might define prompts such as:

  • Generate a secure stored procedure.
  • Review SQL for performance issues.
  • Explain an execution plan.
  • Generate Azure SQL documentation.
  • Review database security.

These prompts promote consistency and help developers follow organizational standards.


How MCP Works

Consider this prompt:

Optimize my stored procedure and recommend missing indexes.

Without MCP:

The AI only analyzes the SQL text supplied by the developer.

With MCP:

The AI can:

  1. Inspect the actual schema.
  2. Read index metadata.
  3. Review execution statistics.
  4. Analyze execution plans.
  5. Recommend optimizations based on the current database.

The response becomes significantly more accurate because it is grounded in live data rather than assumptions.


Example Workflow

Developer
"Optimize this procedure"
LLM decides additional information is needed
Invoke MCP Tool
Retrieve indexes
Retrieve statistics
Retrieve execution plan
Retrieve schema
Return results to LLM
Generate optimized SQL

MCP in GitHub Copilot

GitHub Copilot increasingly supports MCP-compatible servers that allow Copilot Chat to interact with external development resources.

Depending on the environment and organizational configuration, developers can enable approved MCP servers to provide additional context during coding sessions.

Common scenarios include:

  • accessing repository metadata
  • reading project documentation
  • querying SQL schema information
  • retrieving API specifications
  • integrating with issue tracking systems
  • interacting with approved development tools

When multiple MCP servers are available, Copilot can select the appropriate server based on the user’s request and the permissions granted.


MCP in Microsoft Copilot in Fabric

Copilot in Fabric benefits from MCP by enabling AI to access enterprise data and services while respecting organizational governance.

Examples include:

  • examining Fabric Warehouse metadata
  • understanding Lakehouse schemas
  • retrieving semantic model information
  • exploring SQL endpoints
  • reading documentation
  • accessing Azure AI Search indexes
  • connecting to approved enterprise resources

This allows Copilot to produce responses that are informed by the organization’s current data landscape rather than relying solely on general knowledge.


Tool Selection

One MCP server may expose many tools.

For example:

Azure SQL MCP Server
├── List Tables
├── Execute Query
├── Show Indexes
├── Retrieve Statistics
├── Analyze Execution Plan
├── List Stored Procedures
└── Search Metadata

The AI chooses the appropriate tool based on the user’s request.


Security Model

One of MCP’s primary goals is secure interaction with enterprise systems.

Security principles include:

  • authenticated access
  • authorized operations
  • least privilege
  • explicit user consent where appropriate
  • encrypted communication
  • auditability

The AI never bypasses organizational security policies.

Instead, it operates within the permissions granted to the authenticated user and the configured MCP server.


Authentication

MCP servers generally rely on existing enterprise authentication mechanisms.

Examples include:

  • Microsoft Entra ID
  • OAuth
  • Personal Access Tokens (where appropriate)
  • Managed identities
  • Service principals

Developers should avoid embedding credentials directly in prompts or code.


Authorization

Authentication answers:

Who is the user?

Authorization answers:

What is the user allowed to do?

Even if an MCP server exposes a database, the AI can only perform operations that the authenticated user is permitted to execute.

For example:

Developer A

  • Read schema ✔
  • Read tables ✔
  • Execute SELECT ✔
  • Drop tables ✖

The AI inherits these permissions rather than receiving elevated privileges.


Least Privilege

Microsoft recommends following the principle of least privilege.

Only expose:

  • required databases
  • required APIs
  • required resources
  • approved tools

Avoid granting broad administrative access to MCP servers unless absolutely necessary.


Data Governance

Organizations should establish governance policies for AI-assisted development.

Recommendations include:

  • approve trusted MCP servers
  • monitor AI interactions
  • audit tool usage
  • classify sensitive resources
  • restrict production access
  • review generated SQL
  • require human approval for deployments

Strong governance reduces the risk of accidental exposure of sensitive information or unintended database changes.


Common Security Risks

Potential risks include:

Excessive Permissions

The AI can only be as secure as the permissions granted to it. Overly broad access increases risk.

Sensitive Data Exposure

Developers should avoid exposing confidential production data unless organizational policies permit it.

Prompt Injection

Malicious or misleading instructions embedded in external content could attempt to manipulate AI behavior. Organizations should validate trusted sources and limit exposure to untrusted content.

Unverified SQL

AI-generated SQL should always be reviewed and tested before execution.


Best Practices for Configuring MCP

  • Enable only trusted MCP servers.
  • Grant the minimum required permissions.
  • Review available tools before enabling them.
  • Use enterprise authentication mechanisms.
  • Monitor audit logs where available.
  • Validate AI-generated recommendations.
  • Restrict production resources when appropriate.
  • Keep MCP server configurations up to date.
  • Follow organizational security and compliance policies.

DP-800 Exam Tips

Remember the following points for the exam:

  • MCP is a protocol, not an AI model.
  • MCP standardizes communication between AI assistants and external tools or resources.
  • Clients (such as GitHub Copilot Chat or Copilot in Fabric) use MCP to interact with servers.
  • Servers expose tools, resources, and prompts.
  • Tools perform actions, while resources provide information.
  • AI assistants operate within the authenticated user’s permissions and do not automatically receive elevated privileges.
  • Organizations should enable only trusted MCP servers and follow the principles of least privilege, authentication, authorization, and governance.
  • Understanding the distinction between AI reasoning and externally grounded information retrieved through MCP is an important concept for DP-800.

Go to the DP-800 Exam Prep Hub main page

Configure model and Model Context Protocol (MCP) tool options in a GitHub Copilot or Copilot in Fabric chat session – Part 1 (DP-800 Exam Prep)

Part 1 – Configuring AI Models in GitHub Copilot and Microsoft Copilot in Fabric


This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement SQL solutions by using AI-assisted tools
      --> Configure model and Model Context Protocol (MCP) tool options in a GitHub Copilot or Copilot in Fabric chat session


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

Candidates should understand how to configure and use AI models within GitHub Copilot and Microsoft Copilot in Fabric, select the appropriate model for a task, understand the capabilities and limitations of different models, and use AI effectively when developing SQL solutions.

Unlike traditional SQL development, AI-assisted development requires understanding not only SQL syntax but also how the selected AI model influences the quality, speed, reasoning ability, and accuracy of generated code.


Learning Objectives

After studying this article, you should be able to:

  • Explain how GitHub Copilot and Copilot in Fabric use Large Language Models (LLMs)
  • Describe the role of AI models in SQL development
  • Understand model selection options
  • Compare reasoning-focused models with speed-focused models
  • Choose the appropriate model for database development tasks
  • Understand context windows and token limitations
  • Apply best practices when interacting with AI assistants
  • Recognize exam scenarios involving model configuration

AI-Assisted SQL Development

Modern SQL developers spend significant time performing repetitive tasks such as:

  • Writing CRUD statements
  • Creating stored procedures
  • Building database objects
  • Optimizing queries
  • Writing documentation
  • Generating test data
  • Troubleshooting syntax errors
  • Refactoring legacy SQL

AI assistants accelerate these activities by generating code from natural language.

Instead of writing:

CREATE TABLE Customer
(
CustomerID INT PRIMARY KEY,
FirstName NVARCHAR(100),
LastName NVARCHAR(100),
Email NVARCHAR(200)
)

A developer can simply ask:

Create a customer table with an identity primary key, email validation, audit columns, and an index on Email.

The AI model generates the initial implementation, which the developer reviews and refines.


What Is an AI Model?

An AI model is the language model responsible for interpreting prompts and generating responses.

The model determines:

  • reasoning quality
  • SQL accuracy
  • explanation depth
  • response speed
  • context understanding
  • coding capabilities

Different models are optimized for different workloads.

Some prioritize:

  • speed

Others prioritize:

  • complex reasoning

Others balance both.


GitHub Copilot Architecture

A simplified architecture looks like this:

Developer
GitHub Copilot Chat
Selected AI Model
Generated SQL
Developer Review
Database

The AI never executes SQL automatically.

The developer remains responsible for:

  • reviewing code
  • testing
  • validating security
  • validating performance

Microsoft Copilot in Fabric

Microsoft Copilot in Fabric provides AI assistance across Fabric workloads including:

  • SQL Database
  • Fabric Warehouse
  • Lakehouse
  • Data Engineering
  • Data Science
  • Power BI
  • Notebooks
  • Data Factory
  • Data Warehouse development

For SQL developers, Copilot can:

  • generate SQL
  • explain SQL
  • optimize SQL
  • summarize execution plans
  • generate documentation
  • create sample data
  • troubleshoot errors

Why Model Selection Matters

Different AI models excel at different activities.

For example:

A very fast model may generate:

SELECT *
FROM Orders

A reasoning model might instead suggest:

SELECT
OrderID,
CustomerID,
OrderDate,
TotalAmount
FROM Sales.Orders
WHERE OrderDate >= DATEADD(month,-6,GETDATE());

along with an explanation of:

  • why SELECT * should be avoided
  • indexing recommendations
  • performance implications

The reasoning model produces higher-quality guidance.


Common AI Model Characteristics

Although Microsoft continuously updates available models, most fall into these categories.

Fast Models

Optimized for:

  • rapid responses
  • autocomplete
  • simple SQL
  • syntax correction

Best for:

  • INSERT statements
  • UPDATE statements
  • CREATE TABLE
  • formatting SQL
  • documentation

Advantages

  • very fast
  • low latency
  • excellent for routine work

Disadvantages

  • less detailed reasoning
  • weaker optimization suggestions

Balanced Models

Designed for:

  • coding
  • explanation
  • optimization
  • documentation

Best for:

  • stored procedures
  • views
  • CTEs
  • joins
  • JSON
  • window functions

Advantages

  • good reasoning
  • good speed

Disadvantages

  • may not perform as well as reasoning models on complex architecture questions

Reasoning Models

Reasoning models focus on:

  • architecture
  • optimization
  • debugging
  • security
  • query analysis

Ideal for:

  • execution plans
  • indexing strategy
  • normalization
  • concurrency
  • deadlocks
  • performance tuning

Advantages

  • excellent explanations
  • identifies tradeoffs
  • strong analytical reasoning

Disadvantages

  • slower responses
  • higher computational cost

Choosing the Appropriate Model

A SQL developer should match the model to the task.

TaskRecommended Model Type
Generate CREATE TABLE statementsFast
Explain SQL syntaxBalanced
Write stored proceduresBalanced
Optimize slow queriesReasoning
Analyze execution plansReasoning
Explain indexesReasoning
Generate documentationFast
Review securityReasoning
Refactor codeBalanced
Produce examplesBalanced

Model Selection in GitHub Copilot

Depending on the supported environment and subscription, GitHub Copilot Chat allows users to select from available models.

The workflow generally involves:

  1. Open GitHub Copilot Chat
  2. Open the model selector
  3. Review available models
  4. Choose the appropriate model
  5. Continue the conversation

Changing models changes how future prompts are processed.


Example

Suppose a developer asks:

Optimize this stored procedure.

A reasoning model may return:

  • missing indexes
  • SARGability improvements
  • parameter sniffing considerations
  • execution plan observations
  • rewritten SQL

A fast model may simply reformat the SQL.


Model Selection in Microsoft Copilot in Fabric

Copilot in Fabric similarly enables AI-assisted experiences throughout Microsoft Fabric. Depending on the workload and the capabilities available to your tenant, Copilot uses supported foundation models to generate responses for SQL development, analytics, and data engineering tasks.

When working in Fabric SQL experiences, Copilot can assist with:

  • generating SQL queries
  • explaining existing queries
  • creating tables and views
  • summarizing schemas
  • troubleshooting SQL errors
  • suggesting query improvements
  • documenting database objects

Administrators control whether Copilot features are enabled for a Fabric capacity. Users with access to Copilot interact through the integrated chat interface rather than manually invoking models.


Understanding Context Windows

Every AI model has a maximum amount of information it can process at one time.

This is called the context window.

The context includes:

  • prompts
  • previous conversation
  • SQL scripts
  • schemas
  • documentation

Example:

Prompt
+
Conversation
+
Database Schema
+
SQL Script
=
Context

Larger context windows allow:

  • larger stored procedures
  • multiple tables
  • lengthy conversations
  • larger execution plans

Token Limits

Large Language Models process text as tokens rather than words.

A very large SQL script consumes more tokens than a small query.

If the context exceeds the model’s limit:

  • earlier conversation may be truncated
  • important schema details may be omitted
  • responses may become less accurate

Best practice:

Break very large SQL tasks into smaller requests.


Effective Prompting

Model quality depends heavily on prompt quality.

Poor prompt:

Fix this.

Better prompt:

Optimize this stored procedure for Azure SQL Database. Reduce logical reads while maintaining identical results.

Even better:

Optimize this stored procedure for Azure SQL Database. The Orders table contains 40 million rows. Focus on indexing recommendations, parameter sniffing, and SARGable predicates while preserving the current output.

Specific prompts produce significantly better responses.


Providing Context

Useful context includes:

  • database platform
  • compatibility level
  • schema
  • expected row counts
  • performance goals
  • business rules

Example:

Platform:
Azure SQL Database
Table:
Sales.Orders
Rows:
150 million
Goal:
Reduce CPU utilization
Current execution time:
18 seconds

The more relevant information supplied, the more useful the AI-generated recommendation.


Responsible Use of AI Models

Although AI significantly improves developer productivity, it does not replace professional judgment.

Developers should always:

  • review generated SQL
  • validate security
  • test performance
  • verify business logic
  • confirm permissions
  • review indexes
  • test edge cases

Never assume generated SQL is production-ready without validation.


Common DP-800 Exam Scenarios

The certification exam may present scenarios where you must choose the most appropriate AI model for a particular task.

Examples include:

  • Selecting a reasoning model to analyze an execution plan for a slow query.
  • Choosing a balanced model to generate and explain a stored procedure.
  • Using a fast model to quickly scaffold a set of standard CRUD statements.
  • Understanding that different models may produce different levels of explanation and optimization guidance for the same prompt.

You should also understand that AI-generated SQL should always be reviewed, tested, and validated before deployment.


Best Practices

  • Choose the model that best matches the complexity of the task.
  • Provide detailed prompts with sufficient database context.
  • Include schema information when requesting SQL generation.
  • Break very large requests into smaller, focused prompts.
  • Review all generated SQL for correctness, security, and performance.
  • Validate AI recommendations using execution plans and performance metrics.
  • Avoid sharing sensitive production data unless organizational policies explicitly allow it.
  • Remember that AI assists the developer—it does not replace testing, code review, or database design expertise.

DP-800 Exam Tips

Remember the following points for the exam:

  • AI models differ in reasoning ability, response speed, and context handling.
  • Reasoning-focused models are generally better suited for performance tuning, query optimization, and architectural guidance.
  • Simpler or faster models are appropriate for routine SQL generation and code completion.
  • The quality of AI output depends heavily on the quality of the prompt and the context provided.
  • GitHub Copilot and Copilot in Fabric accelerate development but do not automatically validate correctness or security.
  • Developers remain responsible for reviewing and testing all AI-generated SQL before deployment.

Go to the DP-800 Exam Prep Hub main page

Enable GitHub Copilot and Microsoft Copilot in Fabric (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Design and develop database solutions (35–40%)
   --> Design and implement SQL solutions by using AI-assisted tools
      --> Enable GitHub Copilot and Microsoft Copilot in Fabric


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

The DP-800 exam expects candidates to understand how to enable, configure, and effectively use GitHub Copilot and Microsoft Copilot in Microsoft Fabric to improve SQL development productivity while maintaining security, governance, and responsible AI practices.

Unlike traditional SQL development topics, this objective focuses on using AI-assisted development tools rather than writing SQL syntax itself.

After studying this topic, you should be able to:

  • Understand the purpose of GitHub Copilot and Microsoft Copilot in Fabric.
  • Identify licensing and prerequisite requirements.
  • Enable GitHub Copilot in supported development environments.
  • Enable Copilot features within Microsoft Fabric.
  • Understand tenant, capacity, and workspace requirements.
  • Use AI assistants to generate SQL code.
  • Use AI to explain, optimize, and troubleshoot SQL.
  • Understand responsible AI and governance considerations.
  • Identify security best practices when using AI-assisted development.

What is GitHub Copilot?

GitHub Copilot is an AI-powered coding assistant that helps developers write software by generating code suggestions based on natural language prompts and existing code.

It can:

  • Generate SQL queries
  • Create stored procedures
  • Suggest table definitions
  • Generate JOIN statements
  • Explain SQL code
  • Generate comments and documentation
  • Help debug errors
  • Recommend code improvements
  • Convert natural language into SQL

GitHub Copilot is integrated into popular development environments, including:

  • Visual Studio
  • Visual Studio Code
  • GitHub.com
  • Azure Data Studio (where supported)
  • SQL development environments that support Copilot extensions

For DP-800, GitHub Copilot is primarily used to accelerate SQL database development.


What is Microsoft Copilot in Fabric?

Microsoft Copilot in Microsoft Fabric is an AI assistant built directly into the Microsoft Fabric platform.

Rather than only generating code, Fabric Copilot helps users:

  • Create SQL queries
  • Build Data Warehouses
  • Generate notebooks
  • Explain SQL statements
  • Create Dataflows
  • Build reports
  • Analyze datasets
  • Summarize data
  • Generate semantic model calculations
  • Create pipelines
  • Produce documentation

For SQL developers, Copilot can assist with creating and refining SQL scripts within Fabric Data Warehouse and SQL analytics experiences.


GitHub Copilot vs. Microsoft Copilot in Fabric

FeatureGitHub CopilotMicrosoft Copilot in Fabric
Primary purposeAI coding assistantAI assistant across Fabric workloads
SQL generationYesYes
Code explanationsYesYes
Natural language promptsYesYes
Notebook assistanceLimitedYes
Data Warehouse assistanceYesYes
Power BI integrationNoYes
Fabric workspace integrationNoYes
Development IDE integrationYesLimited to Fabric experiences

GitHub Copilot Prerequisites

Before GitHub Copilot can be used, developers generally need:

  • A GitHub account
  • A GitHub Copilot subscription or enterprise license
  • A supported IDE (Visual Studio, Visual Studio Code, etc.)
  • Internet connectivity
  • Authentication with GitHub

Organizations may centrally manage Copilot licensing through GitHub Enterprise.


Enabling GitHub Copilot in Visual Studio Code

The general process includes:

  1. Install Visual Studio Code.
  2. Sign in to GitHub.
  3. Install the GitHub Copilot extension.
  4. Authenticate your GitHub account.
  5. Verify that your organization permits Copilot usage.
  6. Open a SQL file.
  7. Begin typing or enter a natural language prompt.

Example:

-- Create a stored procedure that returns all orders placed during the last 30 days.

Copilot suggests SQL code that can then be reviewed and edited.


Enabling GitHub Copilot in Visual Studio

Visual Studio includes built-in support for GitHub Copilot after the extension is installed.

Developers typically:

  • Install the GitHub Copilot extension.
  • Sign in using GitHub credentials.
  • Enable Copilot in the IDE settings if required.
  • Open a SQL project.
  • Accept or reject AI-generated suggestions.

Microsoft Fabric Copilot Requirements

Copilot in Microsoft Fabric requires several prerequisites.

These commonly include:

  • A Microsoft Fabric tenant
  • An eligible Fabric capacity that supports Copilot features
  • Administrator approval for Copilot
  • Appropriate user licensing
  • A supported Fabric experience
  • Access to a Fabric workspace

Not every Fabric environment automatically has Copilot enabled.


Enabling Copilot in Microsoft Fabric

Fabric administrators control whether Copilot features are available within the organization.

Typical steps include:

  1. Open the Fabric Admin Portal.
  2. Navigate to Tenant Settings.
  3. Locate Copilot and AI settings.
  4. Enable Copilot for the organization or selected security groups.
  5. Save configuration changes.
  6. Assign users to workspaces with Copilot-enabled capacities.

Organizations may choose to enable Copilot only for specific departments or security groups.


Workspace Considerations

Users generally require:

  • Workspace access
  • Appropriate workspace role
  • Capacity that supports AI features

Having access to Fabric alone does not guarantee Copilot availability.


Security Permissions

Fabric administrators may control:

  • Who can use Copilot
  • Which workspaces allow AI
  • Which security groups receive access
  • Which users can create AI-assisted content

This supports governance and compliance requirements.


Using GitHub Copilot for SQL Development

GitHub Copilot can assist with:

Creating Tables

Example prompt:

Create a SQL table for storing customer orders.

Copilot generates a table definition including columns, data types, and constraints.


Generating Stored Procedures

Example prompt:

Create a stored procedure that returns orders by customer.

Copilot generates the T-SQL, which should then be reviewed before deployment.


Creating Functions

Developers can request:

  • Scalar functions
  • Table-valued functions
  • Aggregate calculations
  • String manipulation
  • Date calculations

Writing Complex Queries

Copilot can generate:

  • JOIN statements
  • CTEs
  • Window functions
  • Recursive queries
  • JSON queries
  • Graph queries
  • Regular expression queries
  • Error handling logic

Using Copilot in Fabric

Fabric Copilot supports natural language interactions.

Example:

Show the top ten customers by total sales during the last fiscal year.

Copilot may generate the corresponding SQL query automatically.


Explaining SQL Code

One valuable feature is code explanation.

Example prompt:

Explain this stored procedure.

Copilot can summarize:

  • joins
  • filters
  • business logic
  • aggregations
  • performance considerations

This is especially useful when maintaining legacy SQL code.


Optimizing SQL Queries

Copilot can suggest improvements such as:

  • adding indexes
  • eliminating unnecessary scans
  • simplifying joins
  • reducing nested queries
  • replacing cursors
  • improving readability

However, recommendations should always be validated using execution plans and performance testing.


AI-Assisted Documentation

Developers can use Copilot to generate:

  • procedure descriptions
  • function documentation
  • parameter explanations
  • inline comments
  • technical documentation

Good documentation improves maintainability and collaboration.


Responsible AI Considerations

Neither GitHub Copilot nor Fabric Copilot should be considered authoritative.

Developers remain responsible for:

  • correctness
  • performance
  • security
  • compliance
  • testing
  • deployment approval

AI accelerates development but does not replace engineering judgment.


Security Best Practices

When using AI assistants:

  • Never include passwords in prompts.
  • Do not paste connection strings.
  • Remove API keys.
  • Avoid sharing production customer data.
  • Use anonymized sample data whenever possible.
  • Review generated SQL for SQL injection vulnerabilities.
  • Verify permissions follow the Principle of Least Privilege.
  • Follow organizational AI governance policies.

Common Limitations

AI assistants may:

  • Generate inefficient SQL.
  • Hallucinate nonexistent syntax.
  • Recommend deprecated features.
  • Omit indexes.
  • Produce insecure dynamic SQL.
  • Misinterpret business requirements.

Always validate generated code before using it in production.


GitHub Copilot vs Manual Development

TaskManual DevelopmentGitHub Copilot
Create SQLFully manualAI-assisted
Write documentationManualAI-generated drafts
Generate stored proceduresManualAI-assisted
Explain existing codeManual analysisAI explanations
Query optimization suggestionsDBA experienceAI recommendations (review required)
Security validationDeveloper responsibilityDeveloper responsibility

DP-800 Exam Tips

Be familiar with:

  • GitHub Copilot licensing prerequisites
  • Supported development environments
  • Fabric Copilot enablement requirements
  • Tenant settings that control Copilot
  • Workspace and capacity requirements
  • Appropriate use of AI-generated SQL
  • Responsible AI principles
  • Security and governance responsibilities
  • Human review of AI-generated code
  • Organizational approval for AI usage

Remember:

GitHub Copilot primarily assists developers inside coding environments, while Microsoft Copilot in Fabric provides AI assistance across multiple Fabric workloads, including SQL development, analytics, notebooks, and reporting.


Key Takeaways

  • GitHub Copilot is an AI-powered coding assistant that accelerates SQL development.
  • Microsoft Copilot in Fabric provides AI assistance throughout the Microsoft Fabric ecosystem.
  • Fabric administrators control Copilot availability through tenant settings and capacity configuration.
  • Developers need appropriate permissions, licensing, and workspace access.
  • AI-generated SQL should always be reviewed, tested, and validated.
  • Sensitive information should never be included in AI prompts.
  • AI improves productivity but does not replace secure software development practices.

Practice Exam Questions

Question 1

A database developer wants to use GitHub Copilot in Visual Studio Code. Which prerequisite is required before Copilot can provide code suggestions?

A. Install the GitHub Copilot extension and authenticate with a licensed GitHub account

B. Enable Microsoft Fabric capacity

C. Create a SQL Server Agent job

D. Install Azure Data Factory

Correct Answer: A

Explanation: GitHub Copilot requires a GitHub account, an appropriate Copilot license, installation of the GitHub Copilot extension, and authentication before AI-powered code suggestions become available.


Question 2

Who typically enables Microsoft Copilot features for an organization using Microsoft Fabric?

A. Every workspace member individually

B. SQL Server service account

C. Fabric administrator through tenant settings

D. Database owner

Correct Answer: C

Explanation: Microsoft Fabric administrators manage Copilot availability through tenant settings and can enable it for the entire organization or selected security groups.


Question 3

Which task is GitHub Copilot best suited to assist with?

A. Replacing SQL Server security auditing

B. Automatically approving production deployments

C. Generating SQL code and stored procedures from natural language prompts

D. Creating Azure subscriptions

Correct Answer: C

Explanation: GitHub Copilot is designed to help developers generate, explain, and improve code, including SQL statements, stored procedures, and database objects.


Question 4

A developer asks Copilot to optimize a SQL query. What should the developer do before deploying the suggested code?

A. Assume the generated code is correct

B. Skip performance testing

C. Disable indexes

D. Review, test, and validate the generated SQL

Correct Answer: D

Explanation: AI-generated code should always undergo testing, performance evaluation, security review, and validation before being used in production.


Question 5

Which Microsoft Fabric requirement is commonly necessary for users to access Copilot features?

A. Workspace access and a Copilot-supported Fabric capacity

B. SQL Server Express Edition

C. Windows Server Failover Clustering

D. SQL Server Agent enabled

Correct Answer: A

Explanation: Users generally require access to a Fabric workspace that resides on a capacity supporting Copilot features, along with the necessary permissions.


Question 6

What is an appropriate use of Microsoft Copilot in Fabric?

A. Automatically bypassing security reviews

B. Generating SQL queries from natural language requests

C. Granting database administrator privileges

D. Disabling tenant governance

Correct Answer: B

Explanation: Fabric Copilot can translate natural language requests into SQL queries and assist with other Fabric workloads, but it does not replace security or governance processes.


Question 7

Which statement best describes the relationship between GitHub Copilot and Microsoft Copilot in Fabric?

A. They perform exactly the same functions in every environment.

B. GitHub Copilot only works with Power BI.

C. Fabric Copilot replaces all integrated development environments.

D. GitHub Copilot primarily assists with coding, while Fabric Copilot assists across multiple Microsoft Fabric experiences.

Correct Answer: D

Explanation: GitHub Copilot focuses on AI-assisted software development within supported IDEs, whereas Fabric Copilot provides AI capabilities across data engineering, analytics, warehousing, notebooks, reporting, and SQL experiences.


Question 8

Which information should never be included in an AI prompt when requesting SQL assistance?

A. Sample table names

B. General business requirements

C. Production passwords and connection strings

D. Desired query output

Correct Answer: C

Explanation: Sensitive information such as passwords, connection strings, API keys, and confidential customer data should never be shared with AI tools.


Question 9

Which benefit does GitHub Copilot provide during SQL development?

A. It automatically deploys production databases.

B. It generates AI-assisted code suggestions that can improve developer productivity.

C. It permanently replaces code reviews.

D. It guarantees optimal query performance.

Correct Answer: B

Explanation: GitHub Copilot accelerates development by generating code suggestions, but developers remain responsible for testing, reviewing, and validating the generated code.


Question 10

Which statement reflects Microsoft’s recommended approach to AI-assisted database development?

A. AI-generated code should always be deployed without modification.

B. AI eliminates the need for peer reviews.

C. AI-generated code should be treated as a draft that developers validate for correctness, security, and performance.

D. AI guarantees compliance with organizational policies.

Correct Answer: C

Explanation: AI-generated code should be viewed as a productivity aid rather than authoritative output. Developers are responsible for verifying functionality, security, performance, compliance, and adherence to organizational standards before deployment.


Go to the DP-800 Exam Prep Hub main page