Introduction
I’ve just installed SSMS 22, and it came with a free version of GitHub Copilot. Is it worth installing?

The short answer is yes, but the long answer is that it is interesting because it is connected to the SQL Server, so it offers nice features. In this article, we will show you how to install and configure and use it.
Installing GitHub Copilot
At the time this article was written, the current version with this feature was the SSMS 22.
First, you will need to install SSMS 22. You can download it here: Install SQL Server Management Studio
During installation, make sure to select the AI Assistance option. This is the option required to have Copilot GitHub (I am not sure why it does not say Copilot AI Assistance).
How much does Copilot GitHub cost?
There is a free edition that supports 50 requests. You also have GitHub Copilot Pro, which costs 10 USD per month or 100 USD per year. You have 300 requests per month, with additional requests at 0.04 USD per request. For more information about prices, refer to this link: About individual GitHub Copilot plans and benefits
Getting Started
To the right of SSMS, you will see GitHub Copilot Chat. You may need a GitHub account for this. To configure a GitHub account, refer to this link and look for the Sign up for the GitHub subscription section.
Once the account is created, log in with the GitHub user and grant permissions to access Visual Studio (SSMS).

If you do not see it in the previous Window, go to View>GitHub Copilot Chat.

You can select the options provided by default and then press the send button.

Is my information safe?
The Copilot GitHub is an extension that connects to a service over the internet. According to Microsoft, the data is safe, and it uses a TLS layer and FIPS Azure encryption.
For more information about security and privacy, refer to this link.
Can Copilot GitHub browse and navigate the internet?
It cannot browse the internet or call APIs over the internet.
What is the last SQL Server version on-premises available?
Copilot:
GitHub Copilot
The latest generally available (GA) on-premises release is SQL Server 2022 (major version 16). SQL Server 2025 is available as a Preview (not GA).
| Item | Version / Notes |
| Latest GA (on-prem) | SQL Server 2022 (major version 16.x) |
| Preview available | SQL Server 2025 — Preview release (not GA) |
| Your connected instance (from the provided context) | SQL Server 2022, ProductVersion = 16.0.1000.6 (RTM) |
If you want to confirm the exact build on your server, run:
-- Created by GitHub Copilot in SSMS - review carefully before executing
SELECT SERVERPROPERTY('ProductVersion') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel,
SERVERPROPERTY('Edition') AS Edition,
@@VERSION AS FullVersion;In the next section, I will check if it can answer trivial questions not related to SQL Server.
Who is the best football player?
Copilot: I’m an AI programming assistant focused on SQL and database tasks — I can’t pick a subjective “best football player.” If you have objective criteria or a dataset, I can run comparisons or produce metrics.
Options I can help with
| Task | What I need from you |
| Compare players by stats | Table name (schema.table) and column names for metrics (goals, assists, ratings) |
| Find the top scorer/leader | Table name and relevant columns, or copy of sample data |
| Pull public stats and analyze | URL or CSV of stats, and the metrics to compare |
Tell me which option you want and provide the schema/table or data and the comparison criteria; I’ll generate the SQL to do it.
Me: As you can see. Copilot GitHub for SSMS is a specialized AI. It is not like a ChatGPT chat. It is a tool specialized in SQL Server. In the next section, we will generate some queries.
Generate some queries in Copilot GitHub
To generate some queries and apply them in Visual Studio, in the Object Explorer, right-click a database and select New query.
Copilot will connect to that database. Now I will send a SQL query to Copilot.
Show the most expensive queries in the database
Copilot: I ran the instance-level DMV check for currently executing requests — there were no active requests returned.
I'll now show a durable list of the most expensive queries historically from the plan cache (top by cumulative CPU). This lists the first 100 characters of each query text per guidance.
-- Created by GitHub Copilot in SSMS - review carefully before executing
SELECT TOP (50)
qs.plan_handle,
sys.fn_varbintohexsubstring(0, qs.query_hash, 1, 0) AS query_hash_hex,
qs.execution_count,
qs.total_worker_time AS total_worker_time,
qs.total_worker_time / 1000.0 AS total_cpu_ms,
qs.total_elapsed_time / 1000.0 AS total_elapsed_ms,
qs.total_logical_reads,
qs.total_physical_reads,
qs.total_logical_writes,
qs.max_worker_time / 1000.0 AS max_cpu_ms,
qs.creation_time,
qs.last_execution_time,
SUBSTRING(st.text, 1, 100) AS sql_text_first100
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st
ORDER BY qs.total_worker_time DESC;Me: You have options to send the query to the query editor. Press Apply to send it.

Also, you can accept with the Tab key or discard the changes using Alt+Del

Next, if you press tab, the code is ready to be used.

Get information from the SQL Server using Copilot GitHub
Another nice thing that you can do is to get information from your server. Let me show you how to do it.
Me: Can you tell me my SQL Server version, the recovery model, and the size in MB of my Adventureworks2022 database?
Copilot: Values retrieved from the current connection (server: DESKTOP-4K, database: AdventureWorks2022).
SQL Server instance | Property | Value | |---|---| | Server name (instance) | DESKTOP-4K | | Product version | 16.0.1000.6 | | Product level | RTM | | Edition | Developer Edition (64-bit) | | Engine edition | 3 (Enterprise) | | Version string | Microsoft SQL Server 2022 (RTM) - 16.0.1000.6 |
AdventureWorks2022 database | Property | Value | |---|---| | Database name | AdventureWorks2022 | | Compatibility level | 160 (SQL Server 2022 / v16) | | Recovery model | FULL | | Size (MB) | 3152.00 MB
Me: As you can see, Copilot GitHub can get information from the SQL Server Engine.
GPT versions
Copilot offers different GPT (Generative Pre-Trained Transformer) versions

You can select the versions of GPT. The GTP 5 mini is the default one. This one is light, faster, and cheaper.
Also, we have the GPT 4.1, which is better for coding and handling a long context. In addition, we have the GPT-4o, which is an omni model that handles text and images. Finally, we have the Claude Haiku 4.5 2, which is a lightweight Claude model.
Optionally, we can select the option Manage Models and select another model of our preference:

Conclusion
Copilot GitHub is a little slow. A 0.04 USD per extra request is a little expensive in my opinion. I think it can help, but several code-generators are using AI. This plugin, however, has some advantages. It can connect directly to the database and retrieve some information. Usually, the other tools are just code generators. This one can analyse index, deadlocks, and simplify your work because it is integrated with the database engine.
If the price works for you and you like the features, it is a great idea to give it a try.