setup-sqlserver
December 7, 2025 · View on GitHub
The missing action for SQL Server :tada:
- Simpler than containers
- Works on Linux and Windows
- Supports different versions
Getting Started
Add it as a step to your workflow
- uses: ankane/setup-sqlserver@v1
with:
accept-eula: true
accept-eula confirms your acceptance of the End-User Licensing Agreement
The default credentials are:
- user:
SA - password:
YourStrong!Passw0rd - host:
localhost - port:
1433
Versions
Specify a version
- uses: ankane/setup-sqlserver@v1
with:
accept-eula: true
sqlserver-version: 2025
Currently supports
| Version | 2025 | 2022 | 2019 |
|---|---|---|---|
ubuntu-24.04 | |||
ubuntu-22.04 | default | ✓ | |
windows-2025 | default | ✓ | ✓ |
windows-2022 | default | ✓ | ✓ |
Test against multiple versions
strategy:
matrix:
sqlserver-version: [2025, 2022]
steps:
- uses: ankane/setup-sqlserver@v1
with:
accept-eula: true
sqlserver-version: ${{ matrix.sqlserver-version }}
Extra Steps
Create a database
- run: sqlcmd -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE testdb'
Run queries
- run: sqlcmd -U SA -P 'YourStrong!Passw0rd' -d testdb -Q 'SELECT @@VERSION'
Related Actions
Resources
Linux
- Install SQL Server and create a database on Ubuntu
- Unattended SQL Server installation script for Ubuntu
Windows
- Install SQL Server from the Command Prompt
- Automating SQL Server Deployment with Packer, Terraform, and Ansible
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features