This article walks you through how to collaboratively work using SQL Server 2025, Visual Studio Code (VS Code), and GitHub Copilot. With clear steps and screenshots, this guide helps beginners and professionals enhance productivity and collaboration in database development.
Prerequisites
Before we begin, make sure you have:
- Windows 10/11 OS
- SQL Server 2025 installed and running
- Visual Studio Code installed
- An active internet connection
Add GitHub Copilot to Visual Studio Code
GitHub Copilot helps you write SQL queries using AI-powered suggestions inside VS Code.
Steps to Add Copilot:
1. Open Visual Studio Code
2. Go to Extensions view
3. Search for “GitHub Copilot”
4. Click Install
5. After installation, click Sign In and authenticate with your GitHub account
![]()
You must have an active GitHub Copilot subscription. Free trials are available for new users.
![]()
After successful setup:
You’ll see Copilot suggestions while writing code
Install SQL Server Extension in VS Code
1. Open Visual Studio Code
2. Go to Extensions view
3. Search for "SQL Server (mssql)" by Microsoft
4. Click Install
![]()
After installation, related SQL Server tools and features become available in Visual Studio Code.
![]()
Connect to SQL Server 2025
1. Press Ctrl + Shift + P → type "MS SQL: Add Connection"
2. Select:
- Server name (e.g., localhost, or .\SQL2025)
- Authentication Type (SQL Login or Windows)
- Username & Password
3. Choose your Database
4. Save the connection if prompted
![]()
After installing you can see that other related SQL Server instances also include in Visual Studio Code.
![]()
Write Queries Using Copilot
1. Open a new SQL file (.sql)
![]()
Click Ctrl+I to open the Copilot Chat window.
2. Start typing a comment like:
create an EmployeeDB and Employee Table in connected DB Server
![]()
3. Copilot will automatically suggest the SQL code
4. Press Tab to accept
![]()
You can execute these commands after entering the correct SQL Server credentials.
![]()
All three commands were successfully completed.
You can check the database explorer and see that database and table created successfully.
![]()
Use Copilot for Query Suggestions
Ask Copilot with comments like:
-- Get all employees who joined in the last 30 days
Or:
-- Suggest optimized index for Employees table
Copilot will return queries or indexing suggestions.
Trouble Shooting Tips
If Copilot doesn’t show suggestions, make sure your GitHub subscription is active and the extension is enabled.
Conclusion
Working with SQL Server 2025, VS Code, and GitHub Copilot gives you a smart, collaborative environment to write, manage, and optimize databases efficiently. It’s especially helpful for:
- Faster development
- Error-free SQL writing
- Learning by examples
Stay tuned for more tutorials on SQL Server 2025 and GitHub Copilot.